blob: 1efe561290dcc3a67be852d26291c1ee7f607f50 [file] [log] [blame] [edit]
import {
html,
fixture,
defineCE,
unsafeStatic,
expect,
} from '@open-wc/testing';
import { TestgridIndex } from '../src/TestgridIndex.js';
describe('ExampleApp', () => {
let element: TestgridIndex;
beforeEach(async () => {
// Need to wrap an element to apply its properties (ex. @customElement)
// See https://open-wc.org/docs/testing/helpers/#test-a-custom-class-with-properties
const tagName = defineCE(class extends TestgridIndex {});
const tag = unsafeStatic(tagName);
element = await fixture(html`<${tag}></${tag}>`);
});
it('renders a button', async () => {
const h1 = element.shadowRoot!.querySelector('mwc-button')!;
expect(h1).to.exist;
});
it('passes the a11y audit', async () => {
await expect(element).shadowDom.to.be.accessible();
});
});