@@ -795,7 +795,7 @@ describe('OMS Single shipment with partial data (missing provider, trackingUrl)'
795795 } )
796796} )
797797
798- describe ( 'BOPIS Order with OMS - Pickup and Delivery' , ( ) => {
798+ describe ( 'BOPIS Order with OMS Single Pickup and Single Delivery' , ( ) => {
799799 // Helper to create BOPIS order with OMS data
800800 const createBopisOmsOrder = ( overrides = { } ) => ( {
801801 orderNo : 'BOPIS-OMS-001' ,
@@ -825,7 +825,6 @@ describe('BOPIS Order with OMS - Pickup and Delivery', () => {
825825 shippingMethod : {
826826 name : 'Ground'
827827 } ,
828- trackingNumber : 'ECOM-TRACK-OLD' ,
829828 shippingAddress : {
830829 fullName : 'Sarah Johnson' ,
831830 address1 : '456 Delivery St' ,
@@ -887,18 +886,8 @@ describe('BOPIS Order with OMS - Pickup and Delivery', () => {
887886 expect ( await screen . findByText ( 'Shipping Method' ) ) . toBeInTheDocument ( )
888887 expect ( await screen . findByText ( / F e d E x / i) ) . toBeInTheDocument ( )
889888 expect ( screen . queryByText ( / G r o u n d / i) ) . not . toBeInTheDocument ( )
890- } )
891-
892- test ( 'should display OMS tracking number as clickable link for delivery shipment' , async ( ) => {
893- setupOrderDetailsPage ( createBopisOmsOrder ( ) )
894- expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
895889 const trackingLink = await screen . findByRole ( 'link' , { name : / B O P I S - T R A C K - 1 2 3 / i} )
896890 expect ( trackingLink ) . toHaveAttribute ( 'href' , 'https://tracking.fedex.com/BOPIS-TRACK-123' )
897- } )
898-
899- test ( 'should display OMS shipment status for delivery shipment' , async ( ) => {
900- setupOrderDetailsPage ( createBopisOmsOrder ( ) )
901- expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
902891 expect ( await screen . findByText ( / S H I P P E D / i) ) . toBeInTheDocument ( )
903892 } )
904893
@@ -1131,17 +1120,27 @@ describe('BOPIS Order with OMS - Multiple Pickup Locations', () => {
11311120 expect ( await screen . findByText ( / P a r t i a l l y R e a d y / i) ) . toBeInTheDocument ( )
11321121 } )
11331122
1134- test ( 'should display OMS provider and tracking for delivery shipment ' , async ( ) => {
1123+ test ( 'should display OMS shipment 1 with UPS provider and tracking ' , async ( ) => {
11351124 setupOrderDetailsPage ( createMultiPickupBopisOmsOrder ( ) )
11361125 expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
11371126 expect ( await screen . findByText ( / U P S / i) ) . toBeInTheDocument ( )
1127+ expect ( await screen . findByText ( / S H I P P E D / i) ) . toBeInTheDocument ( )
11381128 const trackingLink = await screen . findByRole ( 'link' , { name : / M U L T I - T R A C K - 4 5 6 / i} )
11391129 expect ( trackingLink ) . toHaveAttribute (
11401130 'href' ,
11411131 'https://www.ups.com/track?loc=en_US&tracknum=MULTI-TRACK-456'
11421132 )
11431133 } )
11441134
1135+ test ( 'should display OMS shipment 2 with FedEx provider and tracking' , async ( ) => {
1136+ setupOrderDetailsPage ( createMultiPickupBopisOmsOrder ( ) )
1137+ expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
1138+ expect ( await screen . findByText ( / F e d E x / i) ) . toBeInTheDocument ( )
1139+ expect ( await screen . findByText ( / P E N D I N G / i) ) . toBeInTheDocument ( )
1140+ const trackingLink = await screen . findByRole ( 'link' , { name : / M U L T I - T R A C K - 7 8 9 / i} )
1141+ expect ( trackingLink ) . toHaveAttribute ( 'href' , 'https://tracking.fedex.com/MULTI-TRACK-789' )
1142+ } )
1143+
11451144 test ( 'should NOT display shipping address for multi-pickup BOPIS OMS order' , async ( ) => {
11461145 setupOrderDetailsPage ( createMultiPickupBopisOmsOrder ( ) )
11471146 expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
@@ -1164,6 +1163,12 @@ describe('BOPIS Order with OMS - Pickup and Delivery Shipments', () => {
11641163 provider : 'FedEx' ,
11651164 trackingNumber : 'OMS-TRACK-456' ,
11661165 trackingUrl : 'https://tracking.fedex.com/OMS-TRACK-456'
1166+ } ,
1167+ {
1168+ status : 'NEW' ,
1169+ provider : 'UPS' ,
1170+ trackingNumber : 'OMS-TRACK-123' ,
1171+ trackingUrl : 'https://tracking.fedex.com/OMS-TRACK-123'
11671172 }
11681173 ]
11691174 } ,
@@ -1180,8 +1185,6 @@ describe('BOPIS Order with OMS - Pickup and Delivery Shipments', () => {
11801185 shippingMethod : {
11811186 name : 'Ground'
11821187 } ,
1183- shippingStatus : 'shipped' ,
1184- trackingNumber : 'ECOM-TRACK-OLD' ,
11851188 shippingAddress : {
11861189 firstName : 'John' ,
11871190 lastName : 'Doe'
@@ -1230,31 +1233,27 @@ describe('BOPIS Order with OMS - Pickup and Delivery Shipments', () => {
12301233 expect ( await screen . findByText ( / 1 0 0 M a r k e t S t / i) ) . toBeInTheDocument ( )
12311234 } )
12321235
1233- test ( 'should display OMS provider for delivery shipment' , async ( ) => {
1234- setupOrderDetailsPage ( createOmsBopisWithDelivery ( ) )
1235- expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
1236- expect ( await screen . findByText ( / F e d E x / i) ) . toBeInTheDocument ( )
1237- expect ( screen . queryByText ( / G r o u n d / i) ) . not . toBeInTheDocument ( )
1238- } )
1239-
1240- test ( 'should display OMS tracking number as clickable link for delivery' , async ( ) => {
1236+ test ( 'should display OMS shipment 1 and link' , async ( ) => {
12411237 setupOrderDetailsPage ( createOmsBopisWithDelivery ( ) )
12421238 expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
1239+ expect ( await screen . findByText ( / F E D E X / i) ) . toBeInTheDocument ( )
1240+ expect ( await screen . findByText ( / S H I P P E D / i) ) . toBeInTheDocument ( )
12431241 const trackingLink = await screen . findByRole ( 'link' , { name : / O M S - T R A C K - 4 5 6 / i} )
12441242 expect ( trackingLink ) . toHaveAttribute ( 'href' , 'https://tracking.fedex.com/OMS-TRACK-456' )
12451243 } )
12461244
1247- test ( 'should display OMS shipment status for delivery ' , async ( ) => {
1245+ test ( 'should display OMS shipment 2 and link ' , async ( ) => {
12481246 setupOrderDetailsPage ( createOmsBopisWithDelivery ( ) )
12491247 expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
1250- expect ( await screen . findByText ( / S H I P P E D / i) ) . toBeInTheDocument ( )
1248+ expect ( await screen . findByText ( / U P S / i) ) . toBeInTheDocument ( )
1249+ expect ( await screen . findByText ( / N E W / i) ) . toBeInTheDocument ( )
1250+ const trackingLink = await screen . findByRole ( 'link' , { name : / O M S - T R A C K - 1 2 3 / i} )
1251+ expect ( trackingLink ) . toHaveAttribute ( 'href' , 'https://tracking.fedex.com/OMS-TRACK-123' )
12511252 } )
12521253
12531254 test ( 'should NOT display shipping address for OMS BOPIS order with multiple shipments' , async ( ) => {
12541255 setupOrderDetailsPage ( createOmsBopisWithDelivery ( ) )
12551256 expect ( await screen . findByTestId ( 'account-order-details-page' ) ) . toBeInTheDocument ( )
1256- // Shipping address should be hidden for OMS multi-shipment orders
1257- // (order has 2 shipments: 1 pickup + 1 delivery, so order.shipments?.length > 1)
12581257 expect ( screen . queryByRole ( 'heading' , { name : / ^ s h i p p i n g a d d r e s s $ / i} ) ) . not . toBeInTheDocument ( )
12591258 expect ( screen . queryByText ( / J o h n D o e / i) ) . not . toBeInTheDocument ( )
12601259 } )
0 commit comments