diff --git a/bob_party/src/core/tests/gameCasino.test.ts b/bob_party/src/core/tests/gameCasino.test.ts index a2bd66d..1b1cde0 100644 --- a/bob_party/src/core/tests/gameCasino.test.ts +++ b/bob_party/src/core/tests/gameCasino.test.ts @@ -15,9 +15,6 @@ describe('GameMuti get tests', () => { it('should return img ("")', () => { expect(game.getImageSource()).toBe(img); }) - it('should return super jeu', () => { - expect(game.getGameSource()).toBe('super jeu'); - }) it('should return 1', () => { expect(game.getNbPlayerMin()).toBe(1); }) @@ -37,10 +34,6 @@ describe('GameCasino set tests', () => { game.setImageSource(img); expect(game.getImageSource()).toBe(img); }) - it('should return trop cool le jeu', () => { - game.setGameSource('trop cool le jeu'); - expect(game.getGameSource()).toBe('trop cool le jeu'); - }) it('should return trop cool le jeu', () => { game.setNbPlayerMin(2); expect(game.getNbPlayerMin()).toBe(2); diff --git a/bob_party/src/core/tests/gameMulti.test.ts b/bob_party/src/core/tests/gameMulti.test.ts index 9458a7d..3a7053d 100644 --- a/bob_party/src/core/tests/gameMulti.test.ts +++ b/bob_party/src/core/tests/gameMulti.test.ts @@ -23,9 +23,6 @@ describe('GameMulti get tests', () => { it('should return require(blackjack.jpg)', () => { expect(game.getImageSource()).toEqual(img); }) - it('should return super jeu', () => { - expect(game.getGameSource()).toBe('super jeu'); - }) it('should return 1', () => { expect(game.getNbPlayerMin()).toBe(1); }) @@ -48,10 +45,6 @@ describe('GameMulti set tests', () => { game.setImageSource(img); expect(game.getImageSource()).toEqual(img); }) - it('should return trop cool le jeu', () => { - game.setGameSource('trop cool le jeu'); - expect(game.getGameSource()).toBe('trop cool le jeu'); - }) it('should return trop cool le jeu', () => { game.setNbPlayerMin(2); expect(game.getNbPlayerMin()).toBe(2); diff --git a/bob_party/src/core/tests/gameSolo.test.ts b/bob_party/src/core/tests/gameSolo.test.ts index 44843fb..6faa5bf 100644 --- a/bob_party/src/core/tests/gameSolo.test.ts +++ b/bob_party/src/core/tests/gameSolo.test.ts @@ -22,9 +22,6 @@ describe('GameSolo get tests', () => { it('should return blackjack.jpg', () => { expect(game.getImageSource()).toEqual(img); }) - it('should return super jeu', () => { - expect(game.getGameSource()).toBe('super jeu'); - }) it('should return 1', () => { expect(game.getNbPlayerMin()).toBe(1); }) @@ -47,10 +44,6 @@ describe('GameSolo set tests', () => { game.setImageSource(img); expect(game.getImageSource()).toEqual(img); }) - it('should return trop cool le jeu', () => { - game.setGameSource('trop cool le jeu'); - expect(game.getGameSource()).toBe('trop cool le jeu'); - }) it('should return 2', () => { game.setNbPlayerMin(2); expect(game.getNbPlayerMin()).toBe(2); @@ -64,16 +57,16 @@ describe('GameSolo set tests', () => { // Coins Calculator tests describe('GameSolo coins calculator tests', () => { - it('should return 50', () => { - expect(game.coinsCalculator(3)).toBe(50); + it('should return 3', () => { + expect(game.coinsCalculator(3)).toBe(3); }) - it('should return 75', () => { - expect(game.coinsCalculator(4)).toBe(75); + it('should return 4', () => { + expect(game.coinsCalculator(4)).toBe(4); }) - it('should return 100', () => { - expect(game.coinsCalculator(5)).toBe(100); + it('should return 5', () => { + expect(game.coinsCalculator(5)).toBe(5); }) - it('should return 150', () => { - expect(game.coinsCalculator(6)).toBe(150); + it('should return 6', () => { + expect(game.coinsCalculator(6)).toBe(6); }) }) \ No newline at end of file diff --git a/bob_party/src/core/tests/matchSolo.test.ts b/bob_party/src/core/tests/matchSolo.test.ts index f0b36a3..f5d798d 100644 --- a/bob_party/src/core/tests/matchSolo.test.ts +++ b/bob_party/src/core/tests/matchSolo.test.ts @@ -64,20 +64,20 @@ describe('Match set tests', () => { // Update Post-Match tests describe('Update post-match tests', () => { - it('should return 50', () => { + it('should return 3', () => { match.updatePostMatch(tabU[0],3); - expect(tabU[0].getCurrentCoins()).toBe(50); + expect(tabU[0].getCurrentCoins()).toBe(3); }) - it('should return 75', () => { + it('should return 4', () => { match.updatePostMatch(usr2,4); - expect(usr2.getCurrentCoins()).toBe(75); + expect(usr2.getCurrentCoins()).toBe(4); }) - it('should return 150', () => { + it('should return 8', () => { match.updatePostMatch(tabU[0],5); - expect(tabU[0].getCurrentCoins()).toBe(150); + expect(tabU[0].getCurrentCoins()).toBe(8); }) - it('should return 225', () => { + it('should return 10', () => { match.updatePostMatch(usr2,6); - expect(usr2.getCurrentCoins()).toBe(225); + expect(usr2.getCurrentCoins()).toBe(10); }) }) \ No newline at end of file diff --git a/bob_party/src/services/gameService/loaderGameApi.ts b/bob_party/src/services/gameService/loaderGameApi.ts index 2312091..fb28a12 100644 --- a/bob_party/src/services/gameService/loaderGameApi.ts +++ b/bob_party/src/services/gameService/loaderGameApi.ts @@ -20,7 +20,7 @@ export default class LoaderGameApi implements ILoaderGame{ }) .then(function (response: any) { if (response.data != null && response.data != undefined){ - response.data.forEach(game => { + response.data.forEach((game: { type: any; keys: string | any[]; values: any[]; id: number; name: string; image: string; nbPlayerMin: number; nbPlayerMax: number; }) => { switch(game.type){ case "GameSolo": let mapSolo = new Map();