|
@ -156,3 +156,16 @@ test('Build max score cache', () => { |
|
|
|
|
|
|
|
|
expect(queried.length).toEqual(100); |
|
|
expect(queried.length).toEqual(100); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
test('Query score cache', () => { |
|
|
|
|
|
let mockRealm = new MockRealm({schemaVersion: 0}); |
|
|
|
|
|
let testRepo = new ScoreRepo(mockRealm); |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < 100; ++i) { |
|
|
|
|
|
testRepo.createScore({value: i, username: 'user'}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let queried = testRepo.getCachedScores(); |
|
|
|
|
|
|
|
|
|
|
|
expect(queried.length).toEqual(100); |
|
|
|
|
|
}) |