aboutsummaryrefslogtreecommitdiff
path: root/test/background/usecases/StartFindUseCase.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/background/usecases/StartFindUseCase.test.ts')
-rw-r--r--test/background/usecases/StartFindUseCase.test.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/background/usecases/StartFindUseCase.test.ts b/test/background/usecases/StartFindUseCase.test.ts
index 22ff9a5..24e1fdc 100644
--- a/test/background/usecases/StartFindUseCase.test.ts
+++ b/test/background/usecases/StartFindUseCase.test.ts
@@ -2,7 +2,7 @@ import * as sinon from "sinon";
import MockFindClient from "../mock/MockFindClient";
import MockFindRepository from "../mock/MockFindRepository";
import MockConsoleClient from "../mock/MockConsoleClient";
-import MockFramePresenter from "../mock/MockFramePresenter";
+import MockReadyFrameRepository from "../mock/MockReadyFrameRepository";
import StartFindUseCase from "../../../src/background/usecases/StartFindUseCase";
describe("StartFindUseCase", () => {
@@ -13,19 +13,19 @@ describe("StartFindUseCase", () => {
const findClient = new MockFindClient();
const findRepository = new MockFindRepository();
const consoleClient = new MockConsoleClient();
- const framePresenter = new MockFramePresenter();
+ const frameRepository = new MockReadyFrameRepository();
const sut = new StartFindUseCase(
findClient,
findRepository,
consoleClient,
- framePresenter
+ frameRepository
);
beforeEach(async () => {
sinon.restore();
sinon
- .stub(framePresenter, "getAllFrameIds")
+ .stub(frameRepository, "getFrameIds")
.returns(Promise.resolve(frameIds));
});
@@ -46,7 +46,7 @@ describe("StartFindUseCase", () => {
const mockFindRepository = sinon.mock(findRepository);
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { frameIds, framePos: 1, keyword });
+ .withArgs(currentTabId, { keyword, frameId: 100 });
const mockConsoleClient = sinon.mock(consoleClient);
mockConsoleClient
.expects("showInfo")
@@ -76,10 +76,10 @@ describe("StartFindUseCase", () => {
mockFindRepository
.expects("getLocalState")
.withArgs(currentTabId)
- .returns(Promise.resolve({ keyword, frameIds, framePos: 0 }));
+ .returns(Promise.resolve({ keyword, frameId: 0 }));
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { frameIds, framePos: 1, keyword });
+ .withArgs(currentTabId, { keyword, frameId: 100 });
const mockConsoleClient = sinon.mock(consoleClient);
mockConsoleClient
.expects("showInfo")
@@ -115,7 +115,7 @@ describe("StartFindUseCase", () => {
.returns(Promise.resolve(keyword));
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { frameIds, framePos: 1, keyword });
+ .withArgs(currentTabId, { keyword, frameId: 100 });
const mockConsoleClient = sinon.mock(consoleClient);
mockConsoleClient
.expects("showInfo")