Browse Source

score cache unit test

pull/11/head
Tim Glasgow 3 years ago
parent
commit
0480144322
  1. 11
      squarenotsquare/__tests__/Repo-test.js

11
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);
})
Loading…
Cancel
Save