From c523d75472a16dc58e2e4c4ee51eb15efe6c11f9 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 29 Nov 2020 13:55:26 +0900 Subject: Add operators' test --- .../operators/impls/EnableAddonOperator.test.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/content/operators/impls/EnableAddonOperator.test.ts (limited to 'test/content/operators/impls/EnableAddonOperator.test.ts') diff --git a/test/content/operators/impls/EnableAddonOperator.test.ts b/test/content/operators/impls/EnableAddonOperator.test.ts new file mode 100644 index 0000000..a6ca31b --- /dev/null +++ b/test/content/operators/impls/EnableAddonOperator.test.ts @@ -0,0 +1,19 @@ +import { expect } from "chai"; +import EnableAddonOperator from "../../../../src/content/operators/impls/EnableAddonOperator"; +import MockAddonIndicatorClient from "../../mock/MockAddonIndicatorClient"; +import MockAddonEnabledRepository from "../../mock/MockAddonEnabledRepository"; + +describe("EnableAddonOperator", () => { + describe("#run", () => { + it("enabled addon", async () => { + const client = new MockAddonIndicatorClient(false); + const repository = new MockAddonEnabledRepository(false); + const sut = new EnableAddonOperator(client, repository); + + await sut.run(); + + expect(client.enabled).to.be.true; + expect(repository.enabled).to.be.true; + }); + }); +}); -- cgit v1.2.3