diff options
Diffstat (limited to 'test/background/operators/impls/NavigateLinkNextOperator.test.ts')
-rw-r--r-- | test/background/operators/impls/NavigateLinkNextOperator.test.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/background/operators/impls/NavigateLinkNextOperator.test.ts b/test/background/operators/impls/NavigateLinkNextOperator.test.ts index 09c4907..9f19307 100644 --- a/test/background/operators/impls/NavigateLinkNextOperator.test.ts +++ b/test/background/operators/impls/NavigateLinkNextOperator.test.ts @@ -1,4 +1,3 @@ -import sinon from "sinon"; import NavigateLinkNextOperator from "../../../../src/background/operators/impls/NavigateLinkNextOperator"; import MockTabPresenter from "../../mock/MockTabPresenter"; import MockNavigateClient from "../../mock/MockNavigateClient"; @@ -7,7 +6,9 @@ describe("NavigateLinkNextOperator", () => { describe("#run", () => { it("send a message to navigate next page", async () => { const navigateClient = new MockNavigateClient(); - const mock = sinon.mock(navigateClient).expects("linkNext").withArgs(1); + const linkNextSpy = jest + .spyOn(navigateClient, "linkNext") + .mockReturnValueOnce(Promise.resolve()); const tabPresenter = new MockTabPresenter(); await tabPresenter.create("https://example.com/1", { active: false }); await tabPresenter.create("https://example.com/2", { active: true }); @@ -16,7 +17,7 @@ describe("NavigateLinkNextOperator", () => { await sut.run(); - mock.verify(); + expect(linkNextSpy).toBeCalledWith(1); }); }); }); |