forked from aboutmydreams/aiis.read
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # src/welcome/Profile/Reward.tsx
- Loading branch information
Showing
22 changed files
with
330 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { render } from '@testing-library/react'; | ||
|
||
import { NumberDisplayer } from './NumberDisplayer'; | ||
|
||
it('bignumber should work well', () => { | ||
expect(render(<NumberDisplayer text="3368437500000000" />).container).toMatchSnapshot(); | ||
}); | ||
it('integer should be append two zero to tail', () => { | ||
expect(render(<NumberDisplayer text="3000000000000000000" />).container).toMatchSnapshot(); | ||
}); | ||
it('if interer part great than 1, decimal part should have 2 decimals', () => { | ||
expect(render(<NumberDisplayer text="3145000000000000000" />).container).toMatchSnapshot(); | ||
}); | ||
it('if integer part less than 1, decimal part should have 4 decimals', () => { | ||
expect(render(<NumberDisplayer text="145000000000000000" />).container).toMatchSnapshot(); | ||
}); | ||
it('if decimal part less than 0.0001, decimal part should round into 4 decimals', () => { | ||
expect(render(<NumberDisplayer text="000000000012457" />).container).toMatchSnapshot(); | ||
}); | ||
|
||
it('should throw error if text is not string', () => { | ||
expect(() => | ||
render(<NumberDisplayer text={3.14 as unknown as string} />) | ||
).toThrowErrorMatchingSnapshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/components/__snapshots__/NumberDisplayer.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`bignumber should work well 1`] = ` | ||
<div> | ||
<span> | ||
0.0034 | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`if decimal part less than 0.0001, decimal part should round into 4 decimals 1`] = ` | ||
<div> | ||
<span> | ||
0.0{13}1246 | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`if integer part less than 1, decimal part should have 4 decimals 1`] = ` | ||
<div> | ||
<span> | ||
0.1450 | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`if interer part great than 1, decimal part should have 2 decimals 1`] = ` | ||
<div> | ||
<span> | ||
3.15 | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`integer should be append two zero to tail 1`] = ` | ||
<div> | ||
<span> | ||
3.00 | ||
</span> | ||
</div> | ||
`; | ||
|
||
exports[`should throw error if text is not string 1`] = `"text should be string"`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.