aboutsummaryrefslogtreecommitdiff
path: root/test/content/operators/impls/FollowOperatorFactoryChain.test.ts
blob: 84a4a5201bb50a740ecb25445bbd4c3fe5a923ac (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import * as operations from "../../../../src/shared/operations";
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)).toBeInstanceOf(
        FocusOperator
      );
      expect(sut.create({ type: operations.SCROLL_TOP }, 0)).toBeNull;
    });
  });
});