Mike Phares 127634f5ab Delete self contained Thunder Tests
Back to .net8.0
api/v4/InfinityQS
ApiExplorerSettings
Wafer Counter
Color Sorting
2024-03-13 13:15:56 -07:00

31 lines
1.3 KiB
JavaScript

import { newE2EPage } from "@stencil/core/testing";
describe('ifx-checkbox', () => {
it('should render', async () => {
const page = await newE2EPage();
await page.setContent('<ifx-checkbox></ifx-checkbox>');
const element = await page.find('ifx-checkbox');
expect(element).toHaveClass('hydrated');
});
it('should display slotted content', async () => {
const page = await newE2EPage();
await page.setContent('<ifx-checkbox>Test content</ifx-checkbox>');
const labelContent = await page.evaluate(() => {
const checkbox = document.querySelector('ifx-checkbox');
const slot = checkbox.shadowRoot.querySelector('slot');
const nodes = slot.assignedNodes();
return nodes[0].textContent;
});
expect(labelContent).toBe('Test content');
});
it('should emit ifxChange event when clicked', async () => {
const page = await newE2EPage();
await page.setContent('<ifx-checkbox></ifx-checkbox>');
const checkbox = await page.find('ifx-checkbox');
const ifxChange = await checkbox.spyOnEvent('ifxChange');
const checkboxWrapper = await page.find('ifx-checkbox >>> .checkbox__wrapper');
await checkboxWrapper.click();
expect(ifxChange).toHaveReceivedEvent();
});
});
//# sourceMappingURL=checkbox.e2e.js.map