Add e2e tests for slTag

This commit is contained in:
Chris Haynes
2020-08-28 23:19:30 +01:00
parent 0f93d84ead
commit 805e6ce411

21
test/e2e/tag.e2e.ts Normal file
View 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);
});
});