Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yesil committed Jun 3, 2024
1 parent f0891c4 commit 04ead20
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
18 changes: 9 additions & 9 deletions test/blocks/merch-twp/merch-twp.2cards.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,21 @@
unmockFetch();
});
it('renders merch-twp with 3 tabs and 4 cards', async () => {
const main = document.querySelector('main');
main.innerHTML = '';
const template = document.getElementById('merch-twp');
const clone = document.importNode(template.content, true);
main.append(clone);
const twp = await merchTwp(document.querySelector('.merch-twp'));
const spTheme = createTag('sp-theme',
{
theme: "spectrum",
color: "light",
scale: "large"
}, twp);
return await getModal(null, { id: 'twp-modal', content: spTheme, class: 'twp' });
return await getModal(null, { id: 'twp-modal', content: twp, class: 'twp' });
});
});

});
</script>
<main>
</main>
<template id="merch-twp">
<div class="merch-twp">
<div>
<div>
Expand Down Expand Up @@ -388,8 +389,7 @@ <h5 id="annual-prepaid-2" slot="commitment">Annual, prepaid</h5>
</div>
</div>
</div>
</sp-theme>
</main>
</template>
</body>

</html>
9 changes: 8 additions & 1 deletion test/blocks/merch-twp/merch-twp.3cards.test.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
unmockFetch();
});
it('renders merch-twp with 3 tabs and 4 cards', async () => {
const main = document.querySelector('main');
main.innerHTML = '';
const template = document.getElementById('merch-twp');
const clone = document.importNode(template.content, true);
main.append(clone);
const twp = await merchTwp(document.querySelector('.merch-twp'));
await getModal(null, { id: 'twp-modal', content: twp, class: 'twp' });
expect(twp).to.exist;
Expand All @@ -62,6 +67,8 @@
});
</script>
<main>
</main>
<template id="merch-twp">
<div class="merch-twp">
<div>
<div>
Expand Down Expand Up @@ -470,7 +477,7 @@ <h5 id="annual-prepaid-2" slot="commitment">Annual, prepaid</h5>
</div>
</div>
</div>
</main>
</template>
</body>

</html>

0 comments on commit 04ead20

Please sign in to comment.