import '../../../dist/zn.min.js'; import { expect, fixture, html } from '@open-wc/testing'; describe('', () => { it('should render a component', async () => { const el = await fixture(html` `); expect(el).to.exist; }); it('should colour a custom chip from its override', async () => { const el = await fixture(html` Ticket`); const base = el.shadowRoot!.querySelector('[part="base"]')!; expect(getComputedStyle(base).color).to.equal('rgb(15, 118, 110)'); expect(getComputedStyle(base).backgroundColor).to.match(/0\.1\)$/); }); it('should use the text colour for a custom chip without an override', async () => { const el = await fixture(html`Ticket`); const neutral = await fixture(html`Ticket`); const colour = (chip: HTMLElement) => getComputedStyle(chip.shadowRoot!.querySelector('[part="base"]')!).color; expect(colour(el)).to.equal(colour(neutral)); }); });