UNPKG

fonteva-design-guide

Version:

## Dev, Build and Test

27 lines (20 loc) 863 B
import { createElement } from 'lwc'; import BUTTON_GROUP_TEST from 'c/pfmTest'; describe('c-pfm-button-group', () => { 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('render button group', () => { const element = createElement('c-pfm-test', { is: BUTTON_GROUP_TEST }); document.body.appendChild(element); // Verify button group const bGroup = element.shadowRoot.querySelectorAll('.pfm-test_button-group c-pfm-button-group c-pfm-button'); expect(bGroup.length > 0).toBeTruthy(); expect(bGroup[0].classList.contains('pfm-button_grouped')).toBeTruthy(); }); });