Skip to content

OBPIH-7609 Putaway - assert receiving bins on create putaway page#79

Open
kkrawczyk123 wants to merge 3 commits intomainfrom
OBPIH-7609
Open

OBPIH-7609 Putaway - assert receiving bins on create putaway page#79
kkrawczyk123 wants to merge 3 commits intomainfrom
OBPIH-7609

Conversation

@kkrawczyk123
Copy link
Copy Markdown
Collaborator

added:

  • new elements to existing pages
  • added stock transfer dialog
  • test for asserting receiving bins on create putaway page

Copy link
Copy Markdown
Collaborator

@alannadolny alannadolny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ Can you create a factory for (as an example) received stock movement?
Those "after each" are really big and started to be problematic for future maintenance. So if you can, it would be good to create a factor. I mean:

async function createReceivedStockMovement({
  productId,
  quantity,
  lot,
  expDate,
}) {
  // code
  return {
    stockMovement,
    receivingBin,
    shipmentId,
  };
}

And you there are a lot of repeated code for creating inbounds, etc., so it's not DRY

return this.page.getByRole('cell', { name: 'Choose where stock is being' });
}

async getLocation(locationName: string) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be selectLocation?

Comment on lines +8 to +11
await expect(
this.page.getByRole('dialog', { name: 'Transfer Stock' })
).toBeVisible();
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a getter for the dialog and use it here (and in the transferStockButton)

return this.row
.getByTestId('table-cell')
.getByText(binLocation);
return this.row.getByTestId('table-cell').getByText(binLocation);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a getter for the cell and use it in the getters below

Comment on lines +11 to +12
let STOCK_MOVEMENT: StockMovementResponse;
let STOCK_MOVEMENT_OTHER: StockMovementResponse;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to call them primary stock movement and secondary stock movement

Comment on lines +68 to +107
await test.step('Create 2nd stock movement and receive it', async () => {
STOCK_MOVEMENT_OTHER = await stockMovementService.createInbound({
originId: supplierLocation.id,
});

productService.setProduct('5');
const product = await productService.getProduct();

await stockMovementService.addItemsToInboundStockMovement(
STOCK_MOVEMENT_OTHER.id,
[{ productId: product.id, quantity: 10 }]
);

await stockMovementService.sendInboundStockMovement(
STOCK_MOVEMENT_OTHER.id,
{
shipmentType: ShipmentType.AIR,
}
);

const { data: stockMovement } =
await stockMovementService.getStockMovement(STOCK_MOVEMENT_OTHER.id);
const shipmentId = getShipmentId(stockMovement);
const { data: receipt } = await receivingService.getReceipt(shipmentId);
const receivingBin2 =
AppConfig.instance.receivingBinPrefix +
STOCK_MOVEMENT_OTHER.identifier;

await receivingService.createReceivingBin(shipmentId, receipt);

await receivingService.updateReceivingItems(shipmentId, [
{
shipmentItemId: getShipmentItemId(receipt, 0, 0),
quantityReceiving: 10,
binLocationName: receivingBin2,
},
]);
await receivingService.completeReceipt(shipmentId);
});
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those steps are too wide (this one and the rest)
The step should do one thing, like: 'add items to stock movement', 'move to receiving bin', 'receive'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants