diff options
Diffstat (limited to 'test/background/operators/impls/FindOperatorFactoryChain.ts')
-rw-r--r-- | test/background/operators/impls/FindOperatorFactoryChain.ts | 22 |
1 files changed, 22 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..6b190ed --- /dev/null +++ b/test/background/operators/impls/FindOperatorFactoryChain.ts @@ -0,0 +1,22 @@ +import "reflect-metadata"; +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 })).toBeInstanceOf( + FindNextOperator + ); + expect(sut.create({ type: operations.FIND_PREV })).toBeInstanceOf( + FindPrevOperator + ); + }); + }); +}); |