import { beforeEach, describe, expect, it } from 'vitest' import { fixture, html } from '@open-wc/testing-helpers' import type { UsIcon } from './UsIcon' import './UsIcon' describe('UsIcon', () => { let icon: UsIcon beforeEach(async () => { icon = await fixture(html``) }) it('should be defined', () => { expect(icon).toBeDefined() expect(icon.tagName).toBe('US-ICON') }) it('should have correct props', () => { expect(icon.iconName).not.toBeDefined() expect(icon.color).toBe('currentColor') expect(icon.size).toBe('md') expect(icon.iconTitle).toBe('') expect(icon.ariaLabel).toBe('') expect(icon.dataTestId).toBe('icon') }) it('should update all properties', async () => { icon.iconName = 'smile' icon.color = 'green' icon.size = 'md' icon.title = 'New Title' icon.ariaLabel = 'New Label' await icon.updateComplete expect(icon.iconName).toBe('smile') expect(icon.color).toBe('green') expect(icon.size).toBe('md') expect(icon.title).toBe('New Title') expect(icon.ariaLabel).toBe('New Label') }) })