Skip to content

Commit 3546222

Browse files
committed
fix tests
1 parent 68caa89 commit 3546222

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
@@ -153,25 +153,26 @@ describe('Json Component', () => {
153153
})
154154

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

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

Comments
 (0)