Skip to content

Commit a3caddb

Browse files
add more unit tests and setup cypress tests
1 parent 642c0b7 commit a3caddb

16 files changed

+2030
-29875
lines changed

cypress/integration/App.spec.tsx

-12
This file was deleted.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import '@cypress/react';
2+
import { REELS_NUMBER } from '@/game-configs';
3+
4+
describe('Slot machine', () => {
5+
beforeEach(() => {
6+
cy.visit('http://localhost:3000');
7+
cy.get('[data-cy="reels"] [data-cy="reel"]').as('reel');
8+
});
9+
10+
it('spins the symbols on the slots', () => {
11+
cy.get('@reel').should('have.length', REELS_NUMBER);
12+
cy.get('[data-cy="reels"] [data-cy="reel"]')
13+
.as('controllers')
14+
.find('button')
15+
.filter((i, button) => button.innerText.includes('SPIN'))
16+
.click();
17+
18+
cy.get('[data-cy="reel"] [data-cy="symbol"]')
19+
.as('symbols')
20+
.then($el => {
21+
cy.get('[data-role="registered-tickets"] [data-role="ticket"]')
22+
/* .should('have.length', 1) */
23+
.eq(0)
24+
.should('have.class', 'symbol-spinning');
25+
});
26+
});
27+
});

0 commit comments

Comments
 (0)