@@ -149,25 +149,26 @@ describe('Json Component', () => {
149149} )
150150
151151describe ( 'isPrimitive' , ( ) => {
152- it ( 'returns true only for primitive types' , ( ) => {
153- expect ( isPrimitive ( 'test' ) ) . toBe ( true )
152+ it ( 'returns true only for primitive types (string is an exception)' , ( ) => {
154153 expect ( isPrimitive ( 42 ) ) . toBe ( true )
155154 expect ( isPrimitive ( true ) ) . toBe ( true )
156155 expect ( isPrimitive ( 1n ) ) . toBe ( true )
157156 expect ( isPrimitive ( null ) ) . toBe ( true )
158157 expect ( isPrimitive ( undefined ) ) . toBe ( true )
159158 expect ( isPrimitive ( { } ) ) . toBe ( false )
160159 expect ( isPrimitive ( [ ] ) ) . toBe ( false )
160+ expect ( isPrimitive ( 'test' ) ) . toBe ( false )
161161 } )
162162} )
163163
164164describe ( 'shouldObjectCollapse' , ( ) => {
165165 it ( 'returns true for objects with all primitive values' , ( ) => {
166- expect ( shouldObjectCollapse ( { a : 1 , b : 'test' } ) ) . toBe ( true )
166+ expect ( shouldObjectCollapse ( { a : 1 , b : false } ) ) . toBe ( true )
167167 } )
168168
169169 it ( 'returns false for objects with non-primitive values' , ( ) => {
170170 expect ( shouldObjectCollapse ( { a : 1 , b : { } } ) ) . toBe ( false )
171+ expect ( shouldObjectCollapse ( { a : 1 , b : 'test' } ) ) . toBe ( false )
171172 } )
172173
173174 it ( 'returns true for large objects' , ( ) => {
0 commit comments