aboutsummaryrefslogtreecommitdiff
path: root/test/content/operators/impls/EnableAddonOperator.test.ts
blob: 6025608a0bf84a611dd7d2a2722377a012937625 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { expect } from "chai";
import EnableAddonOperator from "../../../../src/content/operators/impls/EnableAddonOperator";
import MockAddonIndicatorClient from "../../mock/MockAddonIndicatorClient";
import MockAddonEnabledRepository from "../../mock/MockAddonEnabledRepository";
import MockConsoleFramePresenter from "./MockConsoleFramePresenter";

describe("EnableAddonOperator", () => {
  describe("#run", () => {
    it("enabled addon", async () => {
      const client = new MockAddonIndicatorClient(false);
      const repository = new MockAddonEnabledRepository(false);
      const presenter = new MockConsoleFramePresenter(false);
      const sut = new EnableAddonOperator(client, repository, presenter);

      await sut.run();

      expect(client.enabled).to.be.true;
      expect(repository.enabled).to.be.true;
      expect(presenter.attached).to.be.true;
    });
  });
});