@@ -153,25 +153,26 @@ describe('Json Component', () => {
153153} )
154154
155155describe ( 'isPrimitive' , ( ) => {
156- it ( 'returns true only for primitive types' , ( ) => {
157- expect ( isPrimitive ( 'test' ) ) . toBe ( true )
156+ it ( 'returns true only for primitive types (string is an exception)' , ( ) => {
158157 expect ( isPrimitive ( 42 ) ) . toBe ( true )
159158 expect ( isPrimitive ( true ) ) . toBe ( true )
160159 expect ( isPrimitive ( 1n ) ) . toBe ( true )
161160 expect ( isPrimitive ( null ) ) . toBe ( true )
162161 expect ( isPrimitive ( undefined ) ) . toBe ( true )
163162 expect ( isPrimitive ( { } ) ) . toBe ( false )
164163 expect ( isPrimitive ( [ ] ) ) . toBe ( false )
164+ expect ( isPrimitive ( 'test' ) ) . toBe ( false )
165165 } )
166166} )
167167
168168describe ( 'shouldObjectCollapse' , ( ) => {
169169 it ( 'returns true for objects with all primitive values' , ( ) => {
170- expect ( shouldObjectCollapse ( { a : 1 , b : 'test' } ) ) . toBe ( true )
170+ expect ( shouldObjectCollapse ( { a : 1 , b : false } ) ) . toBe ( true )
171171 } )
172172
173173 it ( 'returns false for objects with non-primitive values' , ( ) => {
174174 expect ( shouldObjectCollapse ( { a : 1 , b : { } } ) ) . toBe ( false )
175+ expect ( shouldObjectCollapse ( { a : 1 , b : 'test' } ) ) . toBe ( false )
175176 } )
176177
177178 it ( 'returns true for large objects' , ( ) => {
0 commit comments