Skip to content

Commit e14ec97

Browse files
committed
fix tests
1 parent 346528c commit e14ec97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/Json/Json.test.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,25 +149,26 @@ describe('Json Component', () => {
149149
})
150150

151151
describe('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

164164
describe('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

Comments
 (0)