import PIcon from '@squirrel/components/p-icon/p-icon.vue'; import { isComponent } from '@squirrel/utils/component'; describe('isComponent', () => { it('should return true for a valid component object', () => { expect(isComponent(PIcon)).toBe(true); }); it('should return false for null', () => { expect(isComponent(null)).toBe(false); }); it.each([ ['string', 'string'], ['number', 123], ['boolean', true], ['undefined', undefined], ['symbol', Symbol('symbol')], ['function', () => {}], ['array', []], ['date', new Date()], ['regexp', /regex/], ['error', new Error('error')], ['map', new Map()], ['set', new Set()], ])('should return false for a non-component object: %s', (_, value) => { expect(isComponent(value)).toBe(false); }); });