@@ -28,36 +28,11 @@ describe('Policy Scraper', () => {
2828 loadFixture ( 'amazon-com-free-returns.html' ) ;
2929 } ) ;
3030
31- it ( 'should detect free returns ' , async ( ) => {
31+ it ( 'should return null when Amazon shows FREE Returns ' , async ( ) => {
3232 const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
3333
34- expect ( result ) . not . toBeNull ( ) ;
35- expect ( result ! . isFreeReturn ) . toBe ( true ) ;
36- expect ( result ! . returnCost ) . toBeNull ( ) ;
37- } ) ;
38-
39- it ( 'should detect 30-day return window' , async ( ) => {
40- const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
41-
42- expect ( result ) . not . toBeNull ( ) ;
43- expect ( result ! . returnWindow ) . toBe ( 30 ) ;
44- } ) ;
45-
46- it ( 'should set regular return policy correctly' , async ( ) => {
47- const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
48-
49- expect ( result ) . not . toBeNull ( ) ;
50- expect ( result ! . regularReturnPolicy . isFree ) . toBe ( true ) ;
51- expect ( result ! . regularReturnPolicy . cost ) . toBeNull ( ) ;
52- expect ( result ! . regularReturnPolicy . window ) . toBe ( 30 ) ;
53- } ) ;
54-
55- it ( 'should set defective policy as free' , async ( ) => {
56- const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
57-
58- expect ( result ) . not . toBeNull ( ) ;
59- expect ( result ! . defectivePolicy . isFree ) . toBe ( true ) ;
60- expect ( result ! . defectivePolicy . cost ) . toBeNull ( ) ;
34+ // When Amazon displays FREE Returns badge, extension should not show anything
35+ expect ( result ) . toBeNull ( ) ;
6136 } ) ;
6237 } ) ;
6338
@@ -66,19 +41,11 @@ describe('Policy Scraper', () => {
6641 loadFixture ( 'amazon-de-free-returns.html' ) ;
6742 } ) ;
6843
69- it ( 'should detect kostenlose rücksendung ' , async ( ) => {
44+ it ( 'should return null when Amazon shows FREE Returns ' , async ( ) => {
7045 const result = await scrapeProductPagePolicy ( DE_REGION , 'de' ) ;
7146
72- expect ( result ) . not . toBeNull ( ) ;
73- expect ( result ! . isFreeReturn ) . toBe ( true ) ;
74- expect ( result ! . returnCost ) . toBeNull ( ) ;
75- } ) ;
76-
77- it ( 'should detect 14-day return window' , async ( ) => {
78- const result = await scrapeProductPagePolicy ( DE_REGION , 'de' ) ;
79-
80- expect ( result ) . not . toBeNull ( ) ;
81- expect ( result ! . returnWindow ) . toBe ( 14 ) ;
47+ // When Amazon displays FREE Returns badge, extension should not show anything
48+ expect ( result ) . toBeNull ( ) ;
8249 } ) ;
8350 } ) ;
8451
@@ -161,18 +128,11 @@ describe('Policy Scraper', () => {
161128 loadFixture ( 'amazon-com-third-party-free.html' ) ;
162129 } ) ;
163130
164- it ( 'should detect free returns from third party ' , async ( ) => {
131+ it ( 'should return null when Amazon shows FREE Returns ' , async ( ) => {
165132 const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
166133
167- expect ( result ) . not . toBeNull ( ) ;
168- expect ( result ! . isFreeReturn ) . toBe ( true ) ;
169- } ) ;
170-
171- it ( 'should detect extended return window (60 days)' , async ( ) => {
172- const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
173-
174- expect ( result ) . not . toBeNull ( ) ;
175- expect ( result ! . returnWindow ) . toBe ( 60 ) ;
134+ // When Amazon displays FREE Returns badge, extension should not show anything
135+ expect ( result ) . toBeNull ( ) ;
176136 } ) ;
177137 } ) ;
178138
@@ -237,19 +197,11 @@ describe('Policy Scraper', () => {
237197 loadFixture ( 'amazon-com-extended-holiday.html' ) ;
238198 } ) ;
239199
240- it ( 'should detect free returns with extended window' , async ( ) => {
241- const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
242-
243- expect ( result ) . not . toBeNull ( ) ;
244- expect ( result ! . isFreeReturn ) . toBe ( true ) ;
245- expect ( result ! . returnCost ) . toBeNull ( ) ;
246- } ) ;
247-
248- it ( 'should detect 90-day extended holiday return window' , async ( ) => {
200+ it ( 'should return null when Amazon shows FREE Returns' , async ( ) => {
249201 const result = await scrapeProductPagePolicy ( US_REGION , 'en' ) ;
250202
251- expect ( result ) . not . toBeNull ( ) ;
252- expect ( result ! . returnWindow ) . toBe ( 90 ) ;
203+ // When Amazon displays FREE Returns badge, extension should not show anything
204+ expect ( result ) . toBeNull ( ) ;
253205 } ) ;
254206 } ) ;
255207
0 commit comments