aboutsummaryrefslogtreecommitdiff
path: root/test/background/operators/impls/FindNextOperator.test.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-09-23 23:23:55 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-09-25 15:53:36 +0900
commitb72728bdabf140c77f165b35813595dcaa060eea (patch)
tree774dc608f28101ac4a0ecce02e458e421b94dcdc /test/background/operators/impls/FindNextOperator.test.ts
parent01242a2f0d174b4bf8b51fd5627edced465757e9 (diff)
Create find targets by port connections
Diffstat (limited to 'test/background/operators/impls/FindNextOperator.test.ts')
-rw-r--r--test/background/operators/impls/FindNextOperator.test.ts24
1 files changed, 11 insertions, 13 deletions
diff --git a/test/background/operators/impls/FindNextOperator.test.ts b/test/background/operators/impls/FindNextOperator.test.ts
index b5088df..7509ef4 100644
--- a/test/background/operators/impls/FindNextOperator.test.ts
+++ b/test/background/operators/impls/FindNextOperator.test.ts
@@ -32,6 +32,10 @@ describe("FindNextOperator", () => {
active: true,
});
currentTabId = currentTab.id!;
+
+ sinon
+ .stub(frameRepository, "getFrameIds")
+ .returns(Promise.resolve(frameIds));
});
describe("#run", () => {
@@ -54,8 +58,7 @@ describe("FindNextOperator", () => {
sinon.stub(findRepository, "getLocalState").returns(
Promise.resolve({
keyword,
- frameIds,
- framePos: 1,
+ frameId: 100,
})
);
@@ -68,7 +71,7 @@ describe("FindNextOperator", () => {
const mockFindRepository = sinon.mock(findRepository);
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { keyword, frameIds, framePos: 1 });
+ .withArgs(currentTabId, { keyword, frameId: 100 });
await sut.run();
@@ -80,8 +83,7 @@ describe("FindNextOperator", () => {
sinon.stub(findRepository, "getLocalState").returns(
Promise.resolve({
keyword,
- frameIds,
- framePos: 1,
+ frameId: 100,
})
);
@@ -102,7 +104,7 @@ describe("FindNextOperator", () => {
const mockFindRepository = sinon.mock(findRepository);
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { keyword, frameIds, framePos: 2 });
+ .withArgs(currentTabId, { keyword, frameId: 101 });
await sut.run();
@@ -114,8 +116,7 @@ describe("FindNextOperator", () => {
sinon.stub(findRepository, "getLocalState").returns(
Promise.resolve({
keyword,
- frameIds,
- framePos: 2,
+ frameId: 101,
})
);
@@ -136,7 +137,7 @@ describe("FindNextOperator", () => {
const mockFindRepository = sinon.mock(findRepository);
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { keyword, frameIds, framePos: 0 });
+ .withArgs(currentTabId, { keyword, frameId: 0 });
await sut.run();
@@ -151,9 +152,6 @@ describe("FindNextOperator", () => {
sinon
.stub(findRepository, "getGlobalKeyword")
.returns(Promise.resolve(keyword));
- sinon
- .stub(frameRepository, "getFrameIds")
- .returns(Promise.resolve(frameIds));
sinon.stub(consoleClient, "showInfo").returns(Promise.resolve());
const mockFindClient = sinon.mock(findClient);
@@ -168,7 +166,7 @@ describe("FindNextOperator", () => {
const mockFindRepository = sinon.mock(findRepository);
mockFindRepository
.expects("setLocalState")
- .withArgs(currentTabId, { keyword, frameIds, framePos: 0 });
+ .withArgs(currentTabId, { keyword, frameId: 0 });
await sut.run();