generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 176
/
Copy pathmerch-card.ccd-suggested.test.html.js
44 lines (34 loc) · 1.44 KB
/
merch-card.ccd-suggested.test.html.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// @ts-nocheck
import { runTests } from '@web/test-runner-mocha';
import { expect } from '@esm-bundle/chai';
import { mockLana } from './mocks/lana.js';
import { mockFetch } from './mocks/fetch.js';
import './spectrum.js';
import '../src/merch-offer.js';
import '../src/merch-offer-select.js';
import '../src/merch-quantity-select.js';
import { mockIms } from './mocks/ims.js';
import { withWcs } from './mocks/wcs.js';
import mas from './mas.js';
runTests(async () => {
mockIms();
mockLana();
await mockFetch(withWcs);
await mas();
describe('merch-card web component', () => {
it('should exist in the HTML document', async () => {
expect(document.querySelector('merch-card[variant="ccd-suggested"]')).to.exist;
});
it('should have strip with size wide for the ccd-suggested wide card', async () => {
const ccdSliceWideCard = document.querySelector('merch-card[variant="ccd-suggested"][background-image]');
expect(ccdSliceWideCard.getAttribute('variant')).to.equal('ccd-suggested');
expect(ccdSliceWideCard.getAttribute('background-image')).to.exist;
expect(ccdSliceWideCard.className).to.equal('');
});
it('should have dark theme', async () => {
const ccdSliceDarkCard = document.querySelector('merch-card[variant="ccd-suggested"].dark-theme');
const theme = ccdSliceDarkCard.theme.color;
expect(theme).to.equal('dark');
});
});
});