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

describe("NavigateRootOperator", () => {
  describe("#run", () => {
    it("opens root directory in the URL", async () => {
      const tabPresenter = new MockTabPresenter();
      await tabPresenter.create("https://example.com/search?q=apple#top");
      const sut = new NavigateRootOperator(tabPresenter);

      await sut.run();

      const url = (await tabPresenter.getCurrent()).url;
      expect(url).to.be.equal("https://example.com");
    });
  });
});