@@ -570,37 +570,19 @@ test.describe( 'Disputes > Respond to a dispute', () => {
570
570
}
571
571
) ;
572
572
573
- await test . step (
574
- 'Fill in the product type and product description' ,
575
- async ( ) => {
576
- await merchantPage
577
- . getByTestId ( 'dispute-challenge-product-type-selector' )
578
- . selectOption ( 'offline_service' ) ;
579
- await merchantPage
580
- . getByLabel ( 'PRODUCT DESCRIPTION' )
581
- . fill ( 'my product description' ) ;
582
-
583
- // Verify the values were set correctly immediately after filling
584
- await expect (
585
- merchantPage . getByTestId (
586
- 'dispute-challenge-product-type-selector'
587
- )
588
- ) . toHaveValue ( 'offline_service' ) ;
589
-
590
- await expect (
591
- merchantPage . getByLabel ( 'PRODUCT DESCRIPTION' )
592
- ) . toHaveValue ( 'my product description' ) ;
593
- }
594
- ) ;
573
+ await test . step ( 'Fill in the product description' , async ( ) => {
574
+ await merchantPage
575
+ . getByLabel ( 'PRODUCT DESCRIPTION' )
576
+ . fill ( 'my product description' ) ;
595
577
596
- await test . step ( 'Verify form values before saving' , async ( ) => {
597
- // Double-check that the form values are still correct before saving
578
+ // Verify the value was set correctly immediately after filling
598
579
await expect (
599
- merchantPage . getByTestId (
600
- 'dispute-challenge-product-type-selector'
601
- )
602
- ) . toHaveValue ( 'offline_service' ) ;
580
+ merchantPage . getByLabel ( 'PRODUCT DESCRIPTION' )
581
+ ) . toHaveValue ( 'my product description' ) ;
582
+ } ) ;
603
583
584
+ await test . step ( 'Verify form values before saving' , async ( ) => {
585
+ // Double-check that the form value is still correct before saving
604
586
await expect (
605
587
merchantPage . getByLabel ( 'PRODUCT DESCRIPTION' )
606
588
) . toHaveValue ( 'my product description' ) ;
@@ -612,6 +594,13 @@ test.describe( 'Disputes > Respond to a dispute', () => {
612
594
name : 'Save for later' ,
613
595
} )
614
596
. click ( ) ;
597
+
598
+ // Wait for the success snackbar to confirm UI acknowledged the save.
599
+ await expect (
600
+ merchantPage . locator ( '.components-snackbar__content' , {
601
+ hasText : 'Evidence saved!' ,
602
+ } )
603
+ ) . toBeVisible ( { timeout : 10000 } ) ;
615
604
} ) ;
616
605
617
606
await test . step ( 'Go back to the payment details page' , async ( ) => {
@@ -628,7 +617,7 @@ test.describe( 'Disputes > Respond to a dispute', () => {
628
617
) ;
629
618
630
619
await test . step (
631
- 'Verify the previously selected challenge product type is saved ' ,
620
+ 'Verify previously saved values are restored ' ,
632
621
async ( ) => {
633
622
await test . step (
634
623
'Confirm we are on the challenge dispute page' ,
@@ -641,15 +630,15 @@ test.describe( 'Disputes > Respond to a dispute', () => {
641
630
}
642
631
) ;
643
632
633
+ // Wait for description control to be visible
644
634
await merchantPage
645
- . getByTestId ( 'dispute-challenge-product-type-selector ' )
646
- . waitFor ( { timeout : 5000 , state : 'visible' } ) ;
635
+ . getByLabel ( 'PRODUCT DESCRIPTION ' )
636
+ . waitFor ( { timeout : 10000 , state : 'visible' } ) ;
647
637
638
+ // Assert the product description persisted (server stores this under evidence)
648
639
await expect (
649
- merchantPage . getByTestId (
650
- 'dispute-challenge-product-type-selector'
651
- )
652
- ) . toHaveValue ( 'offline_service' ) ;
640
+ merchantPage . getByLabel ( 'PRODUCT DESCRIPTION' )
641
+ ) . toHaveValue ( 'my product description' , { timeout : 10000 } ) ;
653
642
}
654
643
) ;
655
644
} ) ;
0 commit comments