aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators/impls/FindOperatorFactoryChain.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-07-29 22:29:40 +0900
committerGitHub <noreply@github.com>2021-07-29 22:29:40 +0900
commit5592b02a1500062628063862158116f382f3d8e2 (patch)
tree5c29d29a8fa1aa14f4f6407a66bcaf528c42555c /test/background/operators/impls/FindOperatorFactoryChain.ts
parent75236e9a41788f64df61b14a99e78aedc548e0ad (diff)
parent1160cf8aedf9810a76d84e3d99a72365e8aeae8a (diff)
Merge pull request #1213 from ueokande/cross-frame-search
Cross frame search
Diffstat (limited to 'test/background/operators/impls/FindOperatorFactoryChain.ts')
-rw-r--r--test/background/operators/impls/FindOperatorFactoryChain.ts23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/background/operators/impls/FindOperatorFactoryChain.ts b/test/background/operators/impls/FindOperatorFactoryChain.ts
new file mode 100644
index 0000000..0fd234f
--- /dev/null
+++ b/test/background/operators/impls/FindOperatorFactoryChain.ts
@@ -0,0 +1,23 @@
+import "reflect-metadata";
+import { expect } from "chai";
+import TabOperatorFactoryChain from "../../../../src/background/operators/impls/TabOperatorFactoryChain";
+import MockTabPresenter from "../../mock/MockTabPresenter";
+import * as operations from "../../../../src/shared/operations";
+import FindNextOperator from "../../../../src/background/operators/impls/FindNextOperator";
+import FindPrevOperator from "../../../../src/background/operators/impls/FindPrevOperator";
+
+describe("FindOperatorFactoryChain", () => {
+ describe("#create", () => {
+ it("returns a operator for the operation", async () => {
+ const tabPresenter = new MockTabPresenter();
+ const sut = new TabOperatorFactoryChain(tabPresenter);
+
+ expect(sut.create({ type: operations.FIND_NEXT })).to.be.instanceOf(
+ FindNextOperator
+ );
+ expect(sut.create({ type: operations.FIND_PREV })).to.be.instanceOf(
+ FindPrevOperator
+ );
+ });
+ });
+});