File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
redisinsight/ui/src/components/json-viewer/components/json-pretty Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
+ import JSONBigInt from 'json-bigint'
2
3
import { render , screen } from 'uiSrc/utils/test-utils'
3
4
4
5
import JsonPretty from './JsonPretty'
@@ -24,4 +25,16 @@ describe('JsonPretty', () => {
24
25
25
26
expect ( screen . getByTestId ( 'json-primitive-component' ) ) . toBeInTheDocument ( )
26
27
} )
28
+
29
+ it ( 'should render json primitive component with big number' , ( ) => {
30
+ const json = JSONBigInt ( { useNativeBigInt : true } ) . parse ( '1234567890123456789012345678901234567890}' )
31
+ render ( < JsonPretty data = { json } /> )
32
+ expect ( screen . getByTestId ( 'json-primitive-component' ) ) . toBeInTheDocument ( )
33
+ } )
34
+
35
+ it ( 'should render json primitive component with big float' , ( ) => {
36
+ const json = JSONBigInt ( { useNativeBigInt : false } ) . parse ( '1234567890123456789012345678901234567890.1234567890123456789012345678901234567890' )
37
+ render ( < JsonPretty data = { json } /> )
38
+ expect ( screen . getByTestId ( 'json-primitive-component' ) ) . toBeInTheDocument ( )
39
+ } )
27
40
} )
You can’t perform that action at this time.
0 commit comments