aboutsummaryrefslogtreecommitdiff
path: root/test/background/usecases/StartFindUseCase.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-09-26 11:54:11 +0900
committerGitHub <noreply@github.com>2021-09-26 11:54:11 +0900
commit9154972485c24a5a90782cef17f75b3a79a13774 (patch)
tree4bc3d608f498176f50a74ca7fc03d2d501ac7920 /test/background/usecases/StartFindUseCase.test.ts
parentcbf4b37bd0d5ba277d6400ed460d6a086ae1d7bb (diff)
parent91d4712e676782bb58fd7eb03fdc1f85111fca04 (diff)
Merge pull request #1264 from ueokande/fix-establish-connection-issue
Search a content from frames successfully loaded
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")