From 0480144322bdb8b7421e31fe665cd853577efc29 Mon Sep 17 00:00:00 2001 From: Tim Glasgow Date: Thu, 11 Aug 2022 18:27:52 -0500 Subject: [PATCH] score cache unit test --- squarenotsquare/__tests__/Repo-test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/squarenotsquare/__tests__/Repo-test.js b/squarenotsquare/__tests__/Repo-test.js index 5cc5c5c..32e8eb6 100644 --- a/squarenotsquare/__tests__/Repo-test.js +++ b/squarenotsquare/__tests__/Repo-test.js @@ -118,4 +118,15 @@ test('SystemRepo gets multiple system values', () => { mockRealm.create(SystemEntity.name, systemKey2); let response = testRepo.getSystemKeyValue(systemKey1.key); expect(response).toEqual('Multiple system keys found for key1'); +}) + +test('Max out score repo cache', () => { + let mockRealm = new MockRealm({schemaVersion: 0}); + let testRepo = new ScoreRepo(mockRealm); + + for (let i = 0; i < 200; ++i) { + testRepo.updateScoreCache({value: i}) + } + + expect(testRepo.scoreCache.length).toEqual(100); }) \ No newline at end of file