Last active
June 7, 2019 16:06
-
-
Save Tallyb/31eeefb3e559b4755e2fd8391bc9f654 to your computer and use it in GitHub Desktop.
Basic rendering with / witout shadow DOM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('basic', () => { | |
const html = ` | |
<my-basic first="Julia" last="Roberts"> | |
<p slot class="cool">Cool!</p> | |
</my-basic> | |
`; | |
const components = [MyBasic]; | |
it('should render with shadow dom', async () => { | |
const page = await newSpecPage({ | |
html, | |
components | |
}); | |
expect(page.root.shadowRoot).toBeTruthy(); | |
expect(page.root.querySelector('.nice')).toBeFalsy(); | |
expect(page.root.shadowRoot.querySelector('.nice')).toBeTruthy(); | |
expect(page.root.querySelector('.cool')).toBeTruthy(); | |
expect(page.root).toMatchSnapshot(); | |
}); | |
it('should render without shadow dom', async () => { | |
const page = await newSpecPage({ | |
html, | |
components, | |
supportsShadowDom: false | |
}); | |
expect(page.root.shadowRoot).toBeFalsy(); | |
expect(page.root.querySelector('.nice')).toBeTruthy(); | |
expect(page.root.querySelector('.cool')).toBeTruthy(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment