aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators/impls/CancelOperator.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/background/operators/impls/CancelOperator.test.ts')
-rw-r--r--test/background/operators/impls/CancelOperator.test.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/background/operators/impls/CancelOperator.test.ts b/test/background/operators/impls/CancelOperator.test.ts
new file mode 100644
index 0000000..915becf
--- /dev/null
+++ b/test/background/operators/impls/CancelOperator.test.ts
@@ -0,0 +1,24 @@
+import sinon from "sinon";
+import CancelOperator from "../../../../src/background/operators/impls/CancelOperator";
+import MockTabPresenter from "../../mock/MockTabPresenter";
+import MockConsoleClient from "../../mock/MockConsoleClient";
+
+describe("CancelOperator", () => {
+ describe("#run", () => {
+ it("hides console", async () => {
+ const tabPresenter = new MockTabPresenter();
+ const currenTab = await tabPresenter.create("https://example.com/");
+
+ const consoleClient = new MockConsoleClient();
+ const mock = sinon
+ .mock(consoleClient)
+ .expects("hide")
+ .withArgs(currenTab?.id);
+ const sut = new CancelOperator(tabPresenter, consoleClient);
+
+ await sut.run();
+
+ mock.verify();
+ });
+ });
+});