aboutsummaryrefslogtreecommitdiff
path: root/test/background/repositories/ReadyFrameRepository.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/background/repositories/ReadyFrameRepository.test.ts')
-rw-r--r--test/background/repositories/ReadyFrameRepository.test.ts32
1 files changed, 32 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..fb4d34a
--- /dev/null
+++ b/test/background/repositories/ReadyFrameRepository.test.ts
@@ -0,0 +1,32 @@
+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)).toBeUndefined;
+
+ await sut.addFrameId(1, 10);
+ await sut.addFrameId(1, 12);
+ await sut.addFrameId(1, 11);
+ await sut.addFrameId(2, 20);
+ await sut.addFrameId(2, 21);
+ await sut.addFrameId(2, 21);
+
+ expect(await sut.getFrameIds(1)).toEqual([10, 11, 12]);
+ expect(await sut.getFrameIds(2)).toEqual([20, 21]);
+
+ await sut.removeFrameId(2, 21);
+ expect(await sut.getFrameIds(2)).toEqual([20, 21]);
+
+ await sut.removeFrameId(2, 21);
+ expect(await sut.getFrameIds(2)).toEqual([20]);
+
+ await sut.removeFrameId(2, 20);
+ expect(await sut.getFrameIds(2)).toBeUndefined;
+ });
+});