blob: 6026eb122c2cf3217077a7d68c38028a4812ee7c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import { expect } from "chai";
import ToggleAddonOperator from "../../../../src/content/operators/impls/ToggleAddonOperator";
import MockAddonIndicatorClient from "../../mock/MockAddonIndicatorClient";
import MockAddonEnabledRepository from "../../mock/MockAddonEnabledRepository";
describe("ToggleAddonOperator", () => {
describe("#run", () => {
it("toggles addon-enabled state", async () => {
const client = new MockAddonIndicatorClient(true);
const repository = new MockAddonEnabledRepository(true);
const sut = new ToggleAddonOperator(client, repository);
await sut.run();
expect(client.enabled).to.be.false;
expect(repository.enabled).to.be.false;
await sut.run();
expect(client.enabled).to.be.true;
expect(repository.enabled).to.be.true;
});
});
});
|