UNPKG

fonteva-design-guide

Version:

## Dev, Build and Test

28 lines (20 loc) 814 B
import { createElement } from 'lwc'; import TOAST_TEST from 'c/pfmTest'; describe('c-pfm-toast', () => { afterEach(() => { // The jsdom instance is shared across test cases in a single file so reset the DOM while (document.body.firstChild) { document.body.removeChild(document.body.firstChild); } }); it('check toast is added to list', () => { const element = createElement('c-pfm-toast', { is: TOAST_TEST }); document.body.appendChild(element); // Verify toast length is increasing const btn = element.shadowRoot.querySelectorAll('.pfm-button-test c-pfm-button'); const toasts = element.shadowRoot.querySelectorAll('c-pfm-toast > *'); // test needed }); });