Files
webawesome/src/components/skeleton/skeleton.test.ts
Cory LaViska 212ca5b0a6 Fix icons (#997)
* remove

* remove style observer from icons

* fix size example

* unbreak the themer

* remove old test

* remove abstraction

* remove createProperty and initial; fix default attribute values

* skip it to ship it

* cleanup and add ? fallback

* update tests

* fix types

* remove default

* update test

* update tests

* update deps

* update deps

* update deps

* update dep

* fix comment

* downgrade 11ty

* revert deps

* add nunjucks

* prettier

* skip tests for now

* fix parsing error

* prettier

* skip

* sigh webkit

* tidy up icon library examples

* change rando `solid` icon to `regular`

* restore tests

* fix radio group size

* fix button group size

* remove size from card

* fix menu item sizes

* remove card `size` from visual tests and docs

---------

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-05-29 15:59:41 -04:00

49 lines
2.0 KiB
TypeScript

import { expect } from '@open-wc/testing';
import { html } from 'lit';
import { fixtures } from '../../internal/test/fixture.js';
import type WaSkeleton from './skeleton.js';
describe('<wa-skeleton>', () => {
for (const fixture of fixtures) {
describe(`with "${fixture.type}" rendering`, () => {
it('should render default skeleton', async () => {
const el = await fixture<WaSkeleton>(html` <wa-skeleton></wa-skeleton> `);
await expect(el).to.be.accessible();
const indicator = el.shadowRoot!.querySelector<HTMLElement>('[part~="indicator"]')!;
expect(el.getAttribute('effect')).to.equal('none');
expect(indicator.getAttribute('class')).to.equal('indicator');
});
it('should set pulse effect by attribute', async () => {
const el = await fixture<WaSkeleton>(html` <wa-skeleton effect="none"></wa-skeleton> `);
const indicator = el.shadowRoot!.querySelector<HTMLElement>('[part~="indicator"]')!;
const cs = getComputedStyle(indicator);
expect(el.getAttribute('effect')).to.equal('none');
expect(cs.animationName).to.equal('none');
});
it('should set pulse effect by attribute', async () => {
const el = await fixture<WaSkeleton>(html` <wa-skeleton effect="pulse"></wa-skeleton> `);
const indicator = el.shadowRoot!.querySelector<HTMLElement>('[part~="indicator"]')!;
const cs = getComputedStyle(indicator);
expect(el.getAttribute('effect')).to.equal('pulse');
expect(cs.animationName).to.equal('pulse');
});
it('should set sheen effect by attribute', async () => {
const el = await fixture<WaSkeleton>(html` <wa-skeleton effect="sheen"></wa-skeleton> `);
const indicator = el.shadowRoot!.querySelector<HTMLElement>('[part~="indicator"]')!;
const cs = getComputedStyle(indicator);
expect(el.getAttribute('effect')).to.equal('sheen');
expect(cs.animationName).to.equal('sheen');
});
});
}
});