test variants

This commit is contained in:
Cory LaViska
2022-03-24 08:03:14 -04:00
parent 300cbd090f
commit cb460ee7ba

View File

@@ -2,7 +2,18 @@ import { expect, fixture, html } from '@open-wc/testing';
import sinon from 'sinon';
import type SlButton from './button';
const variants = ['default', 'primary', 'success', 'neutral', 'warning', 'danger'];
describe('<sl-button>', () => {
describe('accessibility tests', () => {
variants.forEach(variant => {
it(`should be accessible when variant is "${variant}"`, async () => {
const el = await fixture<SlButton>(html` <sl-button variant="${variant}"> Button Label </sl-button> `);
await expect(el).to.be.accessible();
});
});
});
describe('when provided no parameters', () => {
it('passes accessibility test', async () => {
const el = await fixture<SlButton>(html` <sl-button>Button Label</sl-button> `);