import { beforeEach, describe, expect, it } from 'vitest' import { elementUpdated, fixture, html } from '@open-wc/testing-helpers' import './UsTab' import type { LitElement } from 'lit' import type { ITabProps } from './model/ITabProps' type ITestUsTab = LitElement & ITabProps describe('UsTab', () => { let tab: ITestUsTab beforeEach(async () => { tab = await fixture(html`test`) }) it('should be defined and with correct tag name', () => { expect(tab).toBeDefined() expect(tab.tagName).toBe('US-TAB') }) it('should has slot and correct content of slot', () => { expect(tab.slot).toBeDefined() expect(tab.textContent).toBe('test') }) it('should be selected', () => { expect(tab.hasAttribute('selected')).toBeTruthy() }) it('should be expected attributes', () => { expect(tab.getAttribute('name')).toBe('testName') expect(tab.getAttribute('value')).toBe('testValue') }) it('should be disabled', async () => { tab.disabled = true await elementUpdated(tab) expect(tab.disabled).toBeTruthy() }) })