@@ -2,6 +2,7 @@ import AppConfig from '@/config/AppConfig';
22import { ShipmentType } from '@/constants/ShipmentType' ;
33import { expect , test } from '@/fixtures/fixtures' ;
44import { StockMovementResponse } from '@/types' ;
5+ import BinLocationUtils from '@/utils/BinLocationUtils' ;
56
67test . describe ( 'Assert bin location not clearable' , ( ) => {
78 let STOCK_MOVEMENT : StockMovementResponse ;
@@ -35,24 +36,41 @@ test.describe('Assert bin location not clearable', () => {
3536 }
3637 ) ;
3738
38- test . afterEach ( async ( { stockMovementShowPage, stockMovementService } ) => {
39- await stockMovementShowPage . goToPage ( STOCK_MOVEMENT . id ) ;
40- const isRollbackLastReceiptButtonVisible =
41- await stockMovementShowPage . rollbackLastReceiptButton . isVisible ( ) ;
42- const isRollbackButtonVisible =
43- await stockMovementShowPage . rollbackButton . isVisible ( ) ;
39+ test . afterEach (
40+ async ( {
41+ stockMovementShowPage,
42+ stockMovementService,
43+ mainLocationService,
44+ page,
45+ locationListPage,
46+ createLocationPage,
47+ } ) => {
48+ await stockMovementShowPage . goToPage ( STOCK_MOVEMENT . id ) ;
49+ const isRollbackLastReceiptButtonVisible =
50+ await stockMovementShowPage . rollbackLastReceiptButton . isVisible ( ) ;
51+ const isRollbackButtonVisible =
52+ await stockMovementShowPage . rollbackButton . isVisible ( ) ;
4453
45- // due to failed test, shipment might not be received which will not show the button
46- if ( isRollbackLastReceiptButtonVisible ) {
47- await stockMovementShowPage . rollbackLastReceiptButton . click ( ) ;
48- }
54+ if ( isRollbackLastReceiptButtonVisible ) {
55+ await stockMovementShowPage . rollbackLastReceiptButton . click ( ) ;
56+ }
4957
50- if ( isRollbackButtonVisible ) {
51- await stockMovementShowPage . rollbackButton . click ( ) ;
52- }
58+ if ( isRollbackButtonVisible ) {
59+ await stockMovementShowPage . rollbackButton . click ( ) ;
60+ }
5361
54- await stockMovementService . deleteStockMovement ( STOCK_MOVEMENT . id ) ;
55- } ) ;
62+ await stockMovementService . deleteStockMovement ( STOCK_MOVEMENT . id ) ;
63+ const receivingBin =
64+ AppConfig . instance . receivingBinPrefix + STOCK_MOVEMENT . identifier ;
65+ await BinLocationUtils . deactivateReceivingBin ( {
66+ mainLocationService,
67+ locationListPage,
68+ createLocationPage,
69+ page,
70+ receivingBin,
71+ } ) ;
72+ }
73+ ) ;
5674
5775 test ( 'Assert bin location not clearable' , async ( {
5876 stockMovementShowPage,
@@ -69,7 +87,7 @@ test.describe('Assert bin location not clearable', () => {
6987 } ) ;
7088
7189 await test . step ( 'Assert bin location cant be cleared' , async ( ) => {
72- await expect (
90+ await expect (
7391 receivingPage . receivingStep . table
7492 . row ( 1 )
7593 . binLocationSelect . locator ( '.react-select__clear-indicator' )
@@ -89,7 +107,7 @@ test.describe('Assert bin location not clearable', () => {
89107 await receivingPage . receivingStep . editModal . saveButton . click ( ) ;
90108 } ) ;
91109
92- await test . step ( 'Assertbin location field content after split linw ' , async ( ) => {
110+ await test . step ( 'Assert bin location field content after split line ' , async ( ) => {
93111 const receivingBin =
94112 AppConfig . instance . receivingBinPrefix + STOCK_MOVEMENT . identifier ;
95113 await expect (
0 commit comments