import { html, fixture, expect } from '@open-wc/testing'; import type { MonoHiddenComp } from '../src/MonoHiddenComp'; import '../src/MonoHiddenComp'; describe('MonoHiddenComp', () => { it('handle as, size, family, weight, tracking, tone, inline props and accept a default slot', async () => { const el = await fixture( html`Hey there`, ); expect(el.textContent).to.equal('Hey there'); expect(el.inline).to.equal(true); expect(el.above).to.equal('sm'); expect(el.below).to.equal('md'); }); it('inline should be by default false', async () => { const el = await fixture( html`Hey there`, ); expect(el.inline).to.equal(false); }); it('above should be by default undefined', async () => { const el = await fixture( html`Hey there`, ); expect(el.above).to.equal(undefined); }); it('below should be by default undefined', async () => { const el = await fixture( html`Hey there`, ); expect(el.below).to.equal(undefined); }); it('as will throw if not allowed tag name', async () => { let caught = false; try { await fixture( html`Hey there`, ); } catch (_e) { caught = true; } expect(caught).to.equal(true); }); it('should spreads other attributes', async () => { const el = await fixture( html``, ); expect(el.shadowRoot?.firstElementChild?.getAttribute('fake')).to.equal( 'test', ); }); it('should implement isHidden', async () => { const el = await fixture(html``); expect(el.isHidden()).to.equal(true); }); it('passes the a11y audit', async () => { const el = await fixture(html``); await expect(el).shadowDom.to.be.accessible(); }); });