@@ -19,7 +19,14 @@ import { ProgressTableCellType, XProgressTableCellType } from './progress_table_
19
19
const
20
20
name = 'progress-cell' ,
21
21
progress = 0.0 ,
22
- progressCellProps : ProgressTableCellType = { name }
22
+ progressCellProps : ProgressTableCellType = { name } ,
23
+ progressValues = [
24
+ { input : 0.88 , output : '88%' } ,
25
+ { input : 0.888 , output : '88.8%' } ,
26
+ { input : 0.8888 , output : '88.88%' } ,
27
+ { input : 0.88888 , output : '88.89%' } ,
28
+ { input : 0.88899 , output : '88.90%' } ,
29
+ { input : 0.88999 , output : '89.00%' } , ]
23
30
24
31
describe ( 'ProgressTableCellType.tsx' , ( ) => {
25
32
@@ -32,4 +39,13 @@ describe('ProgressTableCellType.tsx', () => {
32
39
const { queryByTestId } = render ( < XProgressTableCellType model = { progressCellProps } progress = { progress } /> )
33
40
expect ( queryByTestId ( name ) ) . toBeInTheDocument ( )
34
41
} )
42
+
43
+ it ( 'Renders data-test attr with decimal values' , ( ) => {
44
+ const { queryByTestId, rerender } = render ( < XProgressTableCellType model = { progressCellProps } progress = { progress } /> )
45
+ progressValues . map ( progressValue => {
46
+ rerender ( < XProgressTableCellType model = { progressCellProps } progress = { progressValue . input } /> )
47
+ expect ( queryByTestId ( name ) ) . toBeInTheDocument ( )
48
+ expect ( queryByTestId ( name ) ) . toHaveTextContent ( progressValue . output )
49
+ } )
50
+ } )
35
51
} )
0 commit comments