Skip to content

Commit

Permalink
test: remove it.each for single test case
Browse files Browse the repository at this point in the history
  • Loading branch information
MuckT committed Mar 5, 2024
1 parent 93a5631 commit 047325d
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions src/components/TokenBalance.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,24 @@ describe('HomeTokenBalance', () => {
expect(getElementText(tree.getByTestId('TotalTokenBalance'))).toEqual('$8.41')
})

it('renders correctly with one token balance and zero positions', () => {
const store = createMockStore({
...defaultStore,
positions: {
positions: [],
},
})

const tree = render(
<Provider store={store}>
<HomeTokenBalance />
</Provider>
)

expect(tree.queryByTestId('ViewBalances')).toBeTruthy()
expect(getElementText(tree.getByTestId('TotalTokenBalance'))).toEqual('$0.50')
})

it('renders correctly when fetching the token balances failed and no positions', async () => {
const store = createMockStore({
tokens: {
Expand Down Expand Up @@ -496,27 +514,6 @@ describe('FiatExchangeTokenBalance and HomeTokenBalance', () => {
}
)

it.each([HomeTokenBalance])(
'renders correctly with one token balance and zero positions',
async (TokenBalanceComponent) => {
const store = createMockStore({
...defaultStore,
positions: {
positions: [],
},
})

const tree = render(
<Provider store={store}>
<TokenBalanceComponent />
</Provider>
)

expect(tree.queryByTestId('ViewBalances')).toBeTruthy()
expect(getElementText(tree.getByTestId('TotalTokenBalance'))).toEqual('$0.50')
}
)

it.each([HomeTokenBalance, FiatExchangeTokenBalance])(
'renders correctly with one token balance and another token without priceUsd with balance and zero positions',
async (TokenBalanceComponent) => {
Expand Down

0 comments on commit 047325d

Please sign in to comment.