feat(a11y-example) Added my-component

my-component will remove in the future or moved in example. It is just a preview to see, if the tests run
This commit is contained in:
2026-07-16 15:34:35 +02:00
parent 64a6ff6a20
commit 477f2bcc47
@@ -1,4 +1,5 @@
import { render, h, describe, it, expect } from '@stencil/vitest'; import { render, h, describe, it, expect } from '@stencil/vitest';
import { runA11yChecks } from '../../testing/a11y';
describe('my-component', () => { describe('my-component', () => {
it('renders', async () => { it('renders', async () => {
@@ -14,10 +15,15 @@ describe('my-component', () => {
`); `);
}); });
it('has no accessibility violations', async () => {
const { root } = await render(<my-component></my-component>);
const results = await runA11yChecks(root);
expect(results).toHaveNoA11yViolations();
});
it('renders with values', async () => { it('renders with values', async () => {
const { root } = await render( const { root } = await render(<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>);
<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>,
);
await expect(root).toEqualHtml(` await expect(root).toEqualHtml(`
<my-component class="hydrated"> <my-component class="hydrated">
<mock:shadow-root> <mock:shadow-root>