Skip to content

Commit 9acf4d3

Browse files
committed
refactor code, modify all pixels and assert all pixels
1 parent a875ce3 commit 9acf4d3

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

server/test/lobby.store.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ describe('LobbyStore - Data Isolation', () => {
1515
const bufferA = store.getLobbyBuffer(idLobbyA);
1616
const bufferB = store.getLobbyBuffer(idLobbyB);
1717

18-
expect(bufferA[0]).toBe(0);
19-
expect(bufferB[0]).toBe(0);
18+
for (let i = 0; i < bufferA.length; i++) {
19+
store.setPixel(idLobbyA, i, 99);
20+
}
2021

21-
store.setPixel(idLobbyA, 0, 99);
22+
const isLobbyAColorata = bufferA.every(pixel => pixel === 99);
23+
expect(isLobbyAColorata).toBe(true);
2224

23-
expect(bufferA[0]).toBe(99);
24-
expect(bufferB[0]).toBe(0);
25+
const isLobbyBPulita = bufferB.every(pixel => pixel === 0);
26+
expect(isLobbyBPulita).toBe(true);
2527
});
2628
});

0 commit comments

Comments
 (0)