Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manelgavalda committed Nov 10, 2023
1 parent a27a3bd commit af5cf8e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/Feature/Livewire/TokensTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
$tokens->get(0) == $newTokens &&
$tokens->get(1) == $oldTokens->get(1)
)->assertSet('balances', fn ($balances) =>
end($oldBalances['prices']) == $balances['prices'][count($balances['prices']) - 2]
&& end($balances['prices']) == $result->ethereumPrice->usd
&& end($balances['prices_eur']) == $result->ethereumPrice->eur
&& end($balances['totals']) == collect($newTokens)->sum(fn ($token) => $token->price * $token->balance)
&& round(end($balances['totals_eur']), 9) == round(collect($newTokens)->sum(fn ($token) => $token->price_eur * $token->balance), 9)
&& end($balances['ethereum']) == collect($newTokens)->sum(fn ($token) => $token->price * $token->balance / $result->ethereumPrice->usd)
end($oldBalances['prices']) == $balances['prices'][count($balances['prices']) - 2] &&
end($balances['prices']) == $result->ethereumPrice->usd &&
end($balances['prices_eur']) == $result->ethereumPrice->eur &&
end($balances['totals']) == collect($newTokens)->sum(fn ($token) => $token->price * $token->balance) &&
round(end($balances['totals_eur']), 9) == round(collect($newTokens)->sum(fn ($token) => $token->price_eur * $token->balance), 9) &&
end($balances['ethereum']) == collect($newTokens)->sum(fn ($token) => $token->price * $token->balance / $result->ethereumPrice->usd)
);
});

0 comments on commit af5cf8e

Please sign in to comment.