-
Notifications
You must be signed in to change notification settings - Fork 10
Fix RoundedBalance prop combinations #1902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deployed to Cloudflare Pages
|
@@ -91,4 +93,45 @@ describe('RoundedBalance', () => { | |||
expect(screen.getByText('99,999.00000…')).toBeInTheDocument() | |||
}) | |||
}) | |||
|
|||
for (const compactLargeNumbers of [false, true]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every possible combination of params creates tons of useless snapshots. Can we define some test cases instead?
describe('should match snapshot for key configurations', () => {
const testCases = [
// common
{ value: '0.002231', ticker: 'ROSE' },
// compactLargeNumbers
{ value: '15000000', compactLargeNumbers: true },
{ value: '15000000', compactLargeNumbers: false },
// showSign
{ value: '5', showSign: true },
{ value: '-0.0047956', showSign: true },
// link
{
value: '5',
ticker: 'wROSE',
tickerAsLink: true,
tokenAddress: '0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3',
},
// Very small value
{ value: '0.00000000000002231' },
// Very large value
{ value: '1111111111111111111111111111111111111111111111111111' },
// Additional combos / whatever
{ value: '15000000', compactLargeNumbers: true, showSign: true, ticker: 'wROSE' },
{ value: '0.002231', tickerAsLink: true, tokenAddress: '0x8Bc2B030b299964eEfb5e1e0b36991352E56D2D3' },
]
testCases.forEach(params => {
it(`should match snapshot ${util.inspect(params)}`, () => {
...
})
})
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also have more normal tests above but I also want to have all the snapshots because it is not implemented in a composable way
f42b3a4
to
b736f16
Compare
No description provided.