Skip to content

Commit f484693

Browse files
committed
fix: test
1 parent 3f79d8d commit f484693

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

test/templates/html/index.test.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,14 @@ describe('Render Product HTML', () => {
109109

110110
it('should have the correct JSON-LD schema without variants (simple product)', () => {
111111
variations = undefined;
112+
product.specialToDate = '2024-12-31';
113+
112114
const html = htmlTemplateFromContext(DEFAULT_CONTEXT({ config }), product, variations).render();
113115
dom = new JSDOM(html);
114116
document = dom.window.document;
115117

116118
const jsonLdScript = document.querySelector('script[type="application/ld+json"]');
117119

118-
product.attributes.push({
119-
name: 'special_to_date',
120-
value: '2024-12-31',
121-
});
122120
// @ts-ignore
123121
const productTemplate = new JSONTemplate(DEFAULT_CONTEXT({ config }), product, undefined);
124122

@@ -141,7 +139,7 @@ describe('Render Product HTML', () => {
141139
assert.strictEqual(offer.availability, product.inStock ? 'InStock' : 'OutOfStock', `Offer availability for variant ${product.sku} does not match`);
142140
assert.strictEqual(offer.image, product.images[0].url || '', `Offer image for variant ${product.sku} does not match`);
143141
assert.strictEqual(offer.priceSpecification, undefined, 'Offer contains priceSpecification for variant when it should not');
144-
assert.strictEqual(offer.priceValidUntil, product.specialToDate, 'Offer does not contain priceValidUntil for variant');
142+
assert.strictEqual(offer.priceValidUntil, '2024-12-31', 'Offer does not contain priceValidUntil for variant');
145143
});
146144
});
147145

0 commit comments

Comments
 (0)