UNPKG

fonteva-design-guide

Version:

## Dev, Build and Test

36 lines (29 loc) 1.27 kB
import { createElement } from 'lwc'; import CONTAINER_TEST from 'c/pfmTest'; describe('c-pfm-container', () => { 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 container theme', () => { const element = createElement('c-pfm-container', { is: CONTAINER_TEST }); document.body.appendChild(element); // Verify container theme const container = element.shadowRoot.querySelectorAll('.pfm-test_container c-pfm-container'); expect(container[1].theme === 'shade').toBeTruthy(); }); it('check container spacing`', () => { const element = createElement('c-pfm-container', { is: CONTAINER_TEST }); document.body.appendChild(element); // Verify container spacing const container = element.shadowRoot.querySelectorAll('.pfm-test_container c-pfm-container'); expect(container[2].padding === 'pfm-p-around_large').toBeTruthy(); expect(container[2].margin === 'pfm-m-top_large').toBeTruthy(); }); });