kopia lustrzana https://github.com/shoelace-style/shoelace
test variants
rodzic
f34960d82a
commit
347808e86c
|
@ -2,13 +2,19 @@ import { expect, fixture, html } from '@open-wc/testing';
|
|||
import sinon from 'sinon';
|
||||
import type SlButton from './button';
|
||||
|
||||
describe('<sl-button>', () => {
|
||||
describe('when provided no parameters', () => {
|
||||
it('passes accessibility test', async () => {
|
||||
const el = await fixture<SlButton>(html` <sl-button>Button Label</sl-button> `);
|
||||
await expect(el).to.be.accessible();
|
||||
});
|
||||
const variants = ['default', 'primary', 'success', 'neutral', 'warning', 'danger'];
|
||||
|
||||
describe('<sl-button>', () => {
|
||||
describe('accessibility tests', () => {
|
||||
variants.forEach(variant => {
|
||||
it(`is 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('default values are set correctly', async () => {
|
||||
const el = await fixture<SlButton>(html` <sl-button>Button Label</sl-button> `);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue