Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelcureno committed Apr 3, 2024
1 parent c7aa0da commit 415fdfc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/blocks/merch-card/merch-card.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,18 @@ describe('Merch Card with Offer Selection', () => {
expect(quantitySelect.getAttribute('step')).to.equal('1');
});

describe('TwP Merch Card', () => {
it('Displays expected slots ', async () => {
document.body.innerHTML = await readFile({ path: './mocks/twp.html' });
await init(document.querySelector('.twp'));
const merchCard = document.querySelector('merch-card');
const topSection = merchCard.shadowRoot.querySelector('.top-section');
const body = merchCard.shadowRoot.querySelector('.body');
expect(topSection).to.exist;
expect(body).to.exist;
});
});

it('Change quantity select ', async () => {
document.body.innerHTML = await readFile({ path: './mocks/selection-cards.html' });
await init(document.querySelector('.quantity-select'));
Expand Down
20 changes: 20 additions & 0 deletions test/blocks/merch-card/mocks/twp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="merch-card twp">
<div>
<div>
<h3 id="photography"><strong>Photography</strong></h3>
<p>Edit, organize and transform your photos.</p>
<p>--</p>
<p><strong>What you get:</strong></p>
<ul>
<li>Lightroom on desktop, mobile and web</li>
<li>Photoshop on desktop and iPad</li>
<li>Lightroom Classic on desktop</li>
<li>Tutorials, fonts, templates, and more</li>
<li>X,XXX monthly <a href="https://firefly.adobe.com">generative credits</a></li>
</ul>
<p><strong>--</strong></p>
<p><strong>7-day free trial, then</strong></p>
<p><strong>US$9.99/mo</strong></p>
</div>
</div>
</div>

0 comments on commit 415fdfc

Please sign in to comment.