mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
Add e2e tests for slTag
This commit is contained in:
21
test/e2e/tag.e2e.ts
Normal file
21
test/e2e/tag.e2e.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { newE2EPage } from '@stencil/core/testing';
|
||||
|
||||
const testContent = `
|
||||
<sl-tag clearable>Tag</sl-input>
|
||||
`;
|
||||
|
||||
describe('tag', () => {
|
||||
it('should emit slClear when cleared', async () => {
|
||||
const page = await newE2EPage();
|
||||
await page.setContent(testContent);
|
||||
|
||||
const tag = await page.find('sl-tag');
|
||||
const tagClear = await page.find('sl-tag >>> .tag__clear');
|
||||
|
||||
const slClear = await tag.spyOnEvent('slClear');
|
||||
|
||||
await tagClear.click();
|
||||
|
||||
expect(slClear).toHaveReceivedEventTimes(1);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user