@@ -109,16 +109,14 @@ describe('Render Product HTML', () => {
109
109
110
110
it ( 'should have the correct JSON-LD schema without variants (simple product)' , ( ) => {
111
111
variations = undefined ;
112
+ product . specialToDate = '2024-12-31' ;
113
+
112
114
const html = htmlTemplateFromContext ( DEFAULT_CONTEXT ( { config } ) , product , variations ) . render ( ) ;
113
115
dom = new JSDOM ( html ) ;
114
116
document = dom . window . document ;
115
117
116
118
const jsonLdScript = document . querySelector ( 'script[type="application/ld+json"]' ) ;
117
119
118
- product . attributes . push ( {
119
- name : 'special_to_date' ,
120
- value : '2024-12-31' ,
121
- } ) ;
122
120
// @ts -ignore
123
121
const productTemplate = new JSONTemplate ( DEFAULT_CONTEXT ( { config } ) , product , undefined ) ;
124
122
@@ -141,7 +139,7 @@ describe('Render Product HTML', () => {
141
139
assert . strictEqual ( offer . availability , product . inStock ? 'InStock' : 'OutOfStock' , `Offer availability for variant ${ product . sku } does not match` ) ;
142
140
assert . strictEqual ( offer . image , product . images [ 0 ] . url || '' , `Offer image for variant ${ product . sku } does not match` ) ;
143
141
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' ) ;
145
143
} ) ;
146
144
} ) ;
147
145
0 commit comments