From 714a51e525cfeb764fbf971cdae154cbd277be07 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:42:29 -0500 Subject: [PATCH 1/2] fix: asset list cleanup --- components/bank/components/tokenList.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/components/bank/components/tokenList.tsx b/components/bank/components/tokenList.tsx index 1c9b53f..4eb332d 100644 --- a/components/bank/components/tokenList.tsx +++ b/components/bank/components/tokenList.tsx @@ -107,14 +107,9 @@ export function TokenList(props: Readonly) {
-
-

- {truncateString(balance.metadata?.display ?? '', 12)} -

-

- {balance.metadata?.denom_units[0]?.denom.split('/').pop()} -

-
+

+ {truncateString(balance.metadata?.display ?? '', 12).toUpperCase()} +

From bc77d2e6a2afa8ea0c6e026d68ab636763f48165 Mon Sep 17 00:00:00 2001 From: "Felix C. Morency" <1102868+fmorency@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:21:23 -0500 Subject: [PATCH 2/2] fix: tests --- .../components/__tests__/tokenList.test.tsx | 30 ++++++++----------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/components/bank/components/__tests__/tokenList.test.tsx b/components/bank/components/__tests__/tokenList.test.tsx index 30cb698..5f2cf6a 100644 --- a/components/bank/components/__tests__/tokenList.test.tsx +++ b/components/bank/components/__tests__/tokenList.test.tsx @@ -71,7 +71,14 @@ describe('TokenList', () => { pageSize={1} /> ); - expect(screen.getByText('utoken1')).toBeInTheDocument(); + const token1Row = screen.getByLabelText('utoken1'); + expect(token1Row).toBeInTheDocument(); + + const ticker = within(token1Row).getAllByText('TOKEN 1'); + expect(ticker).toHaveLength(2); + + const balance = within(token1Row).getByText('0.001'); + expect(balance).toBeInTheDocument(); }); test('displays loading skeleton when isLoading is true', () => { @@ -114,8 +121,10 @@ describe('TokenList', () => { searchTerm={'Token 1'} /> ); - expect(screen.getByText('Token 1')).toBeInTheDocument(); - expect(screen.queryByText('Token 2')).not.toBeInTheDocument(); + const token1Row = screen.getByLabelText('utoken1'); + const token2Row = screen.queryByLabelText('utoken2'); + expect(token1Row).toBeInTheDocument(); + expect(token2Row).not.toBeInTheDocument(); }); test('opens modal with correct denomination information', async () => { @@ -155,19 +164,4 @@ describe('TokenList', () => { expect(screen.getByText('0.001')).toBeInTheDocument(); expect(screen.getByText('0.002')).toBeInTheDocument(); }); - - test('displays correct base denomination for each token', () => { - renderWithChainProvider( - - ); - expect(screen.getByText('utoken1')).toBeInTheDocument(); - expect(screen.getByText('utoken2')).toBeInTheDocument(); - }); });