Changeset View
Changeset View
Standalone View
Standalone View
cashtab/src/components/Header/__tests__/Header.test.tsx
| Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Lines | it('hides balances if balanceVisible is false', async () => { | ||||
| }); | }); | ||||
| expect(screen.getByTitle('Balance XEC')).toHaveStyle( | expect(screen.getByTitle('Balance XEC')).toHaveStyle( | ||||
| 'text-shadow: 0 0 15px #FFFFFF', | 'text-shadow: 0 0 15px #FFFFFF', | ||||
| ); | ); | ||||
| expect(screen.getByTitle('Balance XECX')).toHaveStyle( | expect(screen.getByTitle('Balance XECX')).toHaveStyle( | ||||
| 'text-shadow: 0 0 15px #FFFFFF', | 'text-shadow: 0 0 15px #FFFFFF', | ||||
| ); | ); | ||||
| expect(screen.getByTitle('Balance FIRMA')).toHaveStyle( | expect(screen.getByTitle('Balance USD')).toHaveStyle( | ||||
Fabien: Firma α would fit as well, your call | |||||
bytesofmanAuthorUnsubmitted Done Inline Actionswill keep it "USD" for now as Cashtab could end up supporting Firma and Firma Alpha bytesofman: will keep it "USD" for now as Cashtab could end up supporting Firma and Firma Alpha | |||||
| 'text-shadow: 0 0 15px #FFFFFF', | 'text-shadow: 0 0 15px #FFFFFF', | ||||
| ); | ); | ||||
| }); | }); | ||||
| it('does not render fiat values if fiatPrice is null', async () => { | it('does not render fiat values if fiatPrice is null', async () => { | ||||
| // Create token mocks for the wallet | // Create token mocks for the wallet | ||||
| const tokenMocks = new Map(); | const tokenMocks = new Map(); | ||||
| tokenMocks.set( | tokenMocks.set( | ||||
| Show All 15 Lines | it('does not render fiat values if fiatPrice is null', async () => { | ||||
| route="/" | route="/" | ||||
| />, | />, | ||||
| ); | ); | ||||
| expect(screen.queryByTitle('Balance XEC Fiat')).not.toBeInTheDocument(); | expect(screen.queryByTitle('Balance XEC Fiat')).not.toBeInTheDocument(); | ||||
| expect( | expect( | ||||
| screen.queryByTitle('Balance XECX Fiat'), | screen.queryByTitle('Balance XECX Fiat'), | ||||
| ).not.toBeInTheDocument(); | ).not.toBeInTheDocument(); | ||||
| expect( | expect(screen.queryByTitle('Balance USD Fiat')).not.toBeInTheDocument(); | ||||
| screen.queryByTitle('Balance FIRMA Fiat'), | |||||
| ).not.toBeInTheDocument(); | |||||
| expect( | expect( | ||||
| screen.queryByTitle('Price in Local Currency'), | screen.queryByTitle('Price in Local Currency'), | ||||
| ).not.toBeInTheDocument(); | ).not.toBeInTheDocument(); | ||||
| }); | }); | ||||
| it('renders fiat price for a non-USD currency', async () => { | it('renders fiat price for a non-USD currency', async () => { | ||||
| const nonUsdSettings = new CashtabSettings(); | const nonUsdSettings = new CashtabSettings(); | ||||
| nonUsdSettings.fiatCurrency = 'gbp'; | nonUsdSettings.fiatCurrency = 'gbp'; | ||||
| ▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | it('does not render fiat price if fiatPrice is null', async () => { | ||||
| const balanceXec = screen.getByTitle('Balance XEC'); | const balanceXec = screen.getByTitle('Balance XEC'); | ||||
| expect(balanceXec).toHaveTextContent('9,513.12 XEC'); | expect(balanceXec).toHaveTextContent('9,513.12 XEC'); | ||||
| expect(balanceXec).toHaveStyle('text-shadow: none'); | expect(balanceXec).toHaveStyle('text-shadow: none'); | ||||
| expect(screen.queryByTitle('Balance XEC Fiat')).not.toBeInTheDocument(); | expect(screen.queryByTitle('Balance XEC Fiat')).not.toBeInTheDocument(); | ||||
| expect( | expect( | ||||
| screen.queryByTitle('Balance XECX Fiat'), | screen.queryByTitle('Balance XECX Fiat'), | ||||
| ).not.toBeInTheDocument(); | ).not.toBeInTheDocument(); | ||||
| expect( | expect(screen.queryByTitle('Balance USD Fiat')).not.toBeInTheDocument(); | ||||
| screen.queryByTitle('Balance FIRMA Fiat'), | |||||
| ).not.toBeInTheDocument(); | |||||
| }); | }); | ||||
| }); | }); | ||||
Firma α would fit as well, your call