diff options
Diffstat (limited to 'test/background/operators/impls/NavigateLinkPrevOperator.test.ts')
-rw-r--r-- | test/background/operators/impls/NavigateLinkPrevOperator.test.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/background/operators/impls/NavigateLinkPrevOperator.test.ts b/test/background/operators/impls/NavigateLinkPrevOperator.test.ts index 6b7f791..37999bd 100644 --- a/test/background/operators/impls/NavigateLinkPrevOperator.test.ts +++ b/test/background/operators/impls/NavigateLinkPrevOperator.test.ts @@ -1,4 +1,3 @@ -import sinon from "sinon"; import NavigateLinkPrevOperator from "../../../../src/background/operators/impls/NavigateLinkPrevOperator"; import MockTabPresenter from "../../mock/MockTabPresenter"; import MockNavigateClient from "../../mock/MockNavigateClient"; @@ -7,7 +6,9 @@ describe("NavigateLinkPrevOperator", () => { describe("#run", () => { it("send a message to navigate next page", async () => { const navigateClient = new MockNavigateClient(); - const mock = sinon.mock(navigateClient).expects("linkPrev").withArgs(1); + const linkPrevSpy = jest + .spyOn(navigateClient, "linkPrev") + .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("NavigateLinkPrevOperator", () => { await sut.run(); - mock.verify(); + expect(linkPrevSpy).toBeCalledWith(1); }); }); }); |