pourquoi ai je cette erreur ( devrait permettre au joueur 1 de déposer et définir l'état waitingPlayer:

      le montant du pari du player1 n'est pas mis à jour correctement
      + expected - actual

      -[object Object]
      +1000000000000000000( sur cette ligne "                expect(player1Balance.toString()).to.equal(web3.utils.toWei("1", "ether"), "le montant du pari du player1 n'est pas mis à jour correctement");
" le test "
            it("devrait permettre au joueur 1 de déposer et définir l'état waitingPlayer", async () => {
                const betAmount = web3.utils.toWei("1", "ether");
                const gameId = 1;
                const initialBalance = 0;

                              
                await penduelInstance.createGame({ from: player1 });
                const receipt = await penduelInstance.deposit({ from: player1, value: betAmount });
                const game = await penduelInstance.games.call(gameId);
                const player1Balance = await penduelInstance.playerBalances(gameId, player1, {from: player1});
                const gameTotalBet = await penduelInstance.gameTotalBets(gameId);
      
                const state = game.state;
                expect(game.player1Bet.bet.toString()).to.equal(betAmount, "le montant du pari du player1 n'est pas mis à jour correctement");
                expect(player1Balance.toString()).to.equal(web3.utils.toWei("1", "ether"), "le montant du pari du player1 n'est pas mis à jour correctement");
                expect(gameTotalBet.bet.toString()).to.equal(betAmount, "le montant du pari du player1 n'est pas mis à jour correctement");
               
                expect(state.toNumber()).to.equal(1); // GameStatus.waitingForPlayers
                expect(game.player1).to.equal(player1, "Le joueur 1 n'est pas correctement enregistré");
                expectEvent(receipt, "BetDeposited", {
                    player: player1,
                    bet: betAmount,
                    state: "1"
                    });
                const finalBalance = await web3.eth.getBalance(player1);
                expect(finalBalance).to.be.bignumber.greatherThan(initialBalance);

            });" la fonction :  function deposit() public payable {
        gameId = getGameId();
        Game storage game = games[gameId];

        require(msg.sender == game.player1 || msg.sender == game.player2, "invalid address");
        require(state == State.createdGame, "game not created");
        
        if (msg.sender == game.player1) {
            require(game.player1Bet.bet == 0, "already bet player1");
            require(msg.value > 0, "bet more than 0");
            game.player1Bet.bet = msg.value;
            state = State.waitingPlayer;
        } else if (msg.sender == game.player2) {
            require(!player2HasBet, "player2 has already bet");
            require(game.player1Bet.bet > 0, "bets after the player1");
            require(msg.value == game.player1Bet.bet, "bets the same amount as Player1");
           player2HasBet = true;
        }
        playerBalances[gameId][msg.sender].balance += msg.value;
        gameTotalBets[gameId].bet += msg.value;
        if (player2HasBet && game.player1Bet.bet > 0) {
            state = State.waitingWord;
        }
        emit BetDeposited(msg.sender, msg.value, uint8(state));
    }"