diff options
Diffstat (limited to 'test/content/operators/impls/FindOperatorFactoryChain.test.ts')
-rw-r--r-- | test/content/operators/impls/FindOperatorFactoryChain.test.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/content/operators/impls/FindOperatorFactoryChain.test.ts b/test/content/operators/impls/FindOperatorFactoryChain.test.ts new file mode 100644 index 0000000..6c599ae --- /dev/null +++ b/test/content/operators/impls/FindOperatorFactoryChain.test.ts @@ -0,0 +1,21 @@ +import * as operations from "../../../../src/shared/operations"; +import { expect } from "chai"; +import FindOperatorFactoryChain from "../../../../src/content/operators/impls/FindOperatorFactoryChain"; +import MockFindMasterClient from "../../mock/MockFindMasterClient"; +import FindNextOperator from "../../../../src/content/operators/impls/FindNextOperator"; +import FindPrevOperator from "../../../../src/content/operators/impls/FindPrevOperator"; + +describe("FindOperatorFactoryChain", () => { + describe("#create", () => { + it("returns an operator", () => { + const sut = new FindOperatorFactoryChain(new MockFindMasterClient()); + expect(sut.create({ type: operations.FIND_NEXT }, 0)).to.be.instanceOf( + FindNextOperator + ); + expect(sut.create({ type: operations.FIND_PREV }, 0)).to.be.instanceOf( + FindPrevOperator + ); + expect(sut.create({ type: operations.SCROLL_TOP }, 0)).to.be.null; + }); + }); +}); |