aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators/impls/ReloadTabOperator.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/background/operators/impls/ReloadTabOperator.test.ts')
-rw-r--r--test/background/operators/impls/ReloadTabOperator.test.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/background/operators/impls/ReloadTabOperator.test.ts b/test/background/operators/impls/ReloadTabOperator.test.ts
index e87782b..0cedf3e 100644
--- a/test/background/operators/impls/ReloadTabOperator.test.ts
+++ b/test/background/operators/impls/ReloadTabOperator.test.ts
@@ -1,4 +1,3 @@
-import sinon from "sinon";
import ReloadTabOperator from "../../../../src/background/operators/impls/ReloadTabOperator";
import MockTabPresenter from "../../mock/MockTabPresenter";
@@ -8,27 +7,28 @@ describe("ReloadTabOperator", () => {
const tabPresenter = new MockTabPresenter();
await tabPresenter.create("https://example.com/", { active: true });
await tabPresenter.create("https://example.com/", { active: false });
- const mock = sinon.mock(tabPresenter).expects("reload").withArgs(0, true);
+ const reloadSpy = jest
+ .spyOn(tabPresenter, "reload")
+ .mockReturnValue(Promise.resolve());
const sut = new ReloadTabOperator(tabPresenter, true);
await sut.run();
- mock.verify();
+ expect(reloadSpy).toBeCalledWith(0, true);
});
it("reloads the current tab without cache", async () => {
const tabPresenter = new MockTabPresenter();
await tabPresenter.create("https://example.com/", { active: true });
await tabPresenter.create("https://example.com/", { active: false });
- const mock = sinon
- .mock(tabPresenter)
- .expects("reload")
- .withArgs(0, false);
+ const reloadSpy = jest
+ .spyOn(tabPresenter, "reload")
+ .mockReturnValue(Promise.resolve());
const sut = new ReloadTabOperator(tabPresenter, false);
await sut.run();
- mock.verify();
+ expect(reloadSpy).toBeCalledWith(0, false);
});
});
});