aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators/impls/ReopenTabOperator.test.ts
blob: 5581f9ad4f87fd0b23fe27a6e11b93a4d603943b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import ReopenTabOperator from "../../../../src/background/operators/impls/ReopenTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";

describe("ReopenTabOperator", () => {
  describe("#run", () => {
    it("reopens closed tabs", async () => {
      const tabPresenter = new MockTabPresenter();
      const reopenSpy = jest
        .spyOn(tabPresenter, "reopen")
        .mockReturnValue(Promise.resolve());

      const sut = new ReopenTabOperator(tabPresenter);
      await sut.run();

      expect(reopenSpy).toBeCalled();
    });
  });
});