Skip to content

Commit

Permalink
spectrum ctas in test file
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelcureno committed Sep 19, 2024
1 parent ae57a05 commit 3a656a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<body>
<script type="module" src="./merch-card.ccd-slice.test.html.js"></script>
<main>
<sp-theme theme="spectrum" color="light" scale="medium">
<merch-card class="" tabindex="0" variant="ccd-slice" filters="" types="">
<sp-status-light size="l" variant="info" dir="ltr"></sp-status-light>
<merch-icon
Expand All @@ -49,17 +50,7 @@
</strong>
</p>
<div slot="footer">
<a
class="con-button blue"
is="checkout-link"
data-checkout-workflow="UCv3"
data-checkout-workflow-step="segmentation"
data-promotion-code="CCI2AAUSQ22440CH"
data-quantity="1"
data-wcs-osi="r_JXAnlFI7xD6FxWKl2ODvZriLYBoSL701Kd1hRyhe8"
data-extra-options="{}"
><span>Buy now</span></a
>
<sp-button size="s" focusable>Buy now</sp-button>
</div>
<div slot="image">
<img src="./img/creative-cloud.png" alt="">
Expand All @@ -81,22 +72,13 @@
<br><a href="https://www.adobe.com/creativecloud/all-apps.html" target="_blank">See terms</a>
</p>
<div slot="footer">
<a
class="con-button blue"
is="checkout-link"
data-checkout-workflow="UCv3"
data-checkout-workflow-step="segmentation"
data-promotion-code="CCI2AAUSQ22440CH"
data-quantity="1"
data-wcs-osi="r_JXAnlFI7xD6FxWKl2ODvZriLYBoSL701Kd1hRyhe8"
data-extra-options="{}"
><span>Register now</span></a
>
<sp-button size="s" focusable>Register now</sp-button>
</div>
<div slot="image">
<img src="./img/max.png" alt="">
</div>
</merch-card>
</sp-theme>
</main>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { mockLana } from './mocks/lana.js';
import { mockFetch } from './mocks/fetch.js';
import { mockConfig } from './mocks/config.js';

import './spectrum.js';
import '../src/merch-offer.js';
import '../src/merch-offer-select.js';
import '../src/merch-quantity-select.js';
Expand All @@ -28,26 +29,11 @@ runTests(async () => {
expect(document.querySelector('merch-card[variant="ccd-slice"]')).to.exist;
});

it('should display a CTA', async () => {
const ccdSliceCard = document.querySelector(
'merch-card[variant="ccd-slice"]',
);
const shadowRoot = ccdSliceCard.shadowRoot;
const cta = ccdSliceCard.querySelector('.con-button');
expect(cta).to.exist;
});

it('should have correct attributes for the ccd-slice wide card', async () => {
const ccdSliceWideCard = document.querySelector('merch-card[variant="ccd-slice"][size="wide"]');
expect(ccdSliceWideCard.getAttribute('variant')).to.equal('ccd-slice');
expect(ccdSliceWideCard.getAttribute('size')).to.equal('wide');
});

it('should display a CTA in the ccd-slice wide card', async () => {
const ccdSliceWideCard = document.querySelector('merch-card[variant="ccd-slice"][size="wide"]');
const cta = ccdSliceWideCard.querySelector('.con-button');
expect(cta).to.exist;
});
});

});
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

</div>
<template id="merch-twp-d2p">
<sp-theme theme="spectrum" color="light" scale="large">
theme="spectrum" color="light" scale="large">
<sp-dialog-base slot="click-content" dismissable underlay no-divider>
<sp-icon-close-circle size="l"></sp-icon-close-circle>
<merch-twp-d2p>
Expand Down

0 comments on commit 3a656a7

Please sign in to comment.