mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Serialize stock fix (#9441)
* Fix bug which hid the "serialize stock" button * Add playwright tests * Adjust check
This commit is contained in:
parent
75b47f8d09
commit
a18b18a3fd
@ -752,10 +752,9 @@ export default function StockDetail() {
|
|||||||
name: t`Serialize`,
|
name: t`Serialize`,
|
||||||
tooltip: t`Serialize stock`,
|
tooltip: t`Serialize stock`,
|
||||||
hidden:
|
hidden:
|
||||||
!canTransfer ||
|
|
||||||
isBuilding ||
|
isBuilding ||
|
||||||
serialized ||
|
serialized ||
|
||||||
stockitem?.quantity != 1 ||
|
stockitem?.quantity < 1 ||
|
||||||
stockitem?.part_detail?.trackable != true,
|
stockitem?.part_detail?.trackable != true,
|
||||||
icon: <InvenTreeIcon icon='serial' iconProps={{ color: 'blue' }} />,
|
icon: <InvenTreeIcon icon='serial' iconProps={{ color: 'blue' }} />,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
|
@ -165,6 +165,22 @@ test('Stock - Serial Numbers', async ({ browser }) => {
|
|||||||
await page.getByRole('button', { name: 'Cancel' }).click();
|
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Stock - Serialize', async ({ browser }) => {
|
||||||
|
const page = await doCachedLogin(browser, { url: 'stock/item/232/details' });
|
||||||
|
|
||||||
|
// Fill out with faulty serial numbers to check buttons and forms
|
||||||
|
await page.getByLabel('action-menu-stock-operations').click();
|
||||||
|
await page.getByLabel('action-menu-stock-operations-serialize').click();
|
||||||
|
|
||||||
|
await page.getByLabel('text-field-serial_numbers').fill('200-250');
|
||||||
|
|
||||||
|
await page.getByRole('button', { name: 'Submit' }).click();
|
||||||
|
await page
|
||||||
|
.getByText('Group range 200-250 exceeds allowed quantity')
|
||||||
|
.waitFor();
|
||||||
|
await page.getByRole('button', { name: 'Cancel' }).click();
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test various 'actions' on the stock detail page
|
* Test various 'actions' on the stock detail page
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user