aboutsummaryrefslogtreecommitdiff
path: root/test/content/operators/impls/FocusOperatorFactoryChain.test.ts
blob: 91f734bec69d61ed1df5bbdd5055d273929e4e8d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import * as operations from "../../../../src/shared/operations";
import { expect } from "chai";
import FocusOperatorFactoryChain from "../../../../src/content/operators/impls/FocusOperatorFactoryChain";
import FocusOperator from "../../../../src/content/operators/impls/FocusOperator";
import MockFocusPresenter from "../../mock/MockFocusPresenter";

describe("FocusOperatorFactoryChain", () => {
  describe("#create", () => {
    it("returns an operator", () => {
      const sut = new FocusOperatorFactoryChain(new MockFocusPresenter());
      expect(sut.create({ type: operations.FOCUS_INPUT }, 0)).to.be.instanceOf(
        FocusOperator
      );
      expect(sut.create({ type: operations.SCROLL_TOP }, 0)).to.be.null;
    });
  });
});