Created
December 18, 2022 01:42
-
-
Save bobbyg603/847f1b4eca80e13d3b7ef3c8f69c06d4 to your computer and use it in GitHub Desktop.
How to Build a Web Component
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
test('sets all card properties', async () => { | |
const el = await fixture(html`<medium-feed .url="${url}"></medium-feed>`) as MediumFeedElement; | |
await el.updateComplete; | |
await waitUntil( | |
() => el.shadowRoot?.querySelectorAll('medium-card').length === cards, | |
'Element did not render children', | |
); | |
const firstCard = el.shadowRoot?.querySelector('medium-card') as MediumCardElement; | |
assert.equal(firstCard?.thumbnail, article.thumbnail); | |
assert.equal(firstCard?.header, article.title); | |
assert.equal(firstCard?.subheader, article.author); | |
assert.isNotEmpty(firstCard?.body); | |
assert.isNotEmpty(firstCard?.footer); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment