aboutsummaryrefslogtreecommitdiff
path: root/test/background/repositories
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2021-09-23 12:44:49 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2021-09-23 13:14:00 +0900
commit01242a2f0d174b4bf8b51fd5627edced465757e9 (patch)
treeb8ab266625ae3244b6ed8c9ff7a92a979e532e91 /test/background/repositories
parentcbf4b37bd0d5ba277d6400ed460d6a086ae1d7bb (diff)
Search a content from frames successfully loaded
Diffstat (limited to 'test/background/repositories')
-rw-r--r--test/background/repositories/ReadyFrameRepository.test.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/background/repositories/ReadyFrameRepository.test.ts b/test/background/repositories/ReadyFrameRepository.test.ts
new file mode 100644
index 0000000..d952a9b
--- /dev/null
+++ b/test/background/repositories/ReadyFrameRepository.test.ts
@@ -0,0 +1,25 @@
+import { expect } from "chai";
+import { ReadyFrameRepositoryImpl } from "../../../src/background/repositories/ReadyFrameRepository";
+
+describe("background/repositories/ReadyFrameRepositoryImpl", () => {
+ let sut: ReadyFrameRepositoryImpl;
+
+ beforeEach(() => {
+ sut = new ReadyFrameRepositoryImpl();
+ });
+
+ it("get and set a keyword", async () => {
+ expect(await sut.getFrameIds(1)).to.be.undefined;
+
+ await sut.addFrameId(1, 10);
+ await sut.addFrameId(1, 11);
+ await sut.addFrameId(2, 20);
+
+ expect(await sut.getFrameIds(1)).to.deep.equal([10, 11]);
+ expect(await sut.getFrameIds(2)).to.deep.equal([20]);
+
+ await sut.clearFrameIds(1);
+
+ expect(await sut.getFrameIds(1)).to.be.undefined;
+ });
+});