mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Use ref pattern on PO duplicate (#9100)
* use ref pattern on PO duplicate * use ref patterns on duplicate for other types of orders * revert unintentional change to pre-commit * add playwright tests --------- Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| import { expect } from '@playwright/test'; | ||||
| import { test } from '../baseFixtures.ts'; | ||||
| import { | ||||
|   clearTableFilters, | ||||
| @@ -325,3 +326,22 @@ test('Build Order - Filters', async ({ page }) => { | ||||
|   await page.getByText('On Hold').first().waitFor(); | ||||
|   await page.getByText('Pending Approval').first().waitFor(); | ||||
| }); | ||||
|  | ||||
| test('Build Order - Duplicate', async ({ page }) => { | ||||
|   await doQuickLogin(page); | ||||
|  | ||||
|   await navigate(page, 'manufacturing/build-order/24/details'); | ||||
|   await page.getByLabel('action-menu-build-order-').click(); | ||||
|   await page.getByLabel('action-menu-build-order-actions-duplicate').click(); | ||||
|  | ||||
|   // Ensure a new reference is suggested | ||||
|   await expect(page.getByLabel('text-field-reference')).not.toBeEmpty(); | ||||
|  | ||||
|   // Submit the duplicate request and ensure it completes | ||||
|   await page.getByRole('button', { name: 'Submit' }).isEnabled(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|   await page.getByRole('tab', { name: 'Build Details' }).waitFor(); | ||||
|   await page.getByRole('tab', { name: 'Build Details' }).click(); | ||||
|  | ||||
|   await page.getByText('Pending').first().waitFor(); | ||||
| }); | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| import { expect } from '@playwright/test'; | ||||
| import { test } from '../baseFixtures.ts'; | ||||
| import { | ||||
|   clearTableFilters, | ||||
| @@ -321,3 +322,22 @@ test('Purchase Orders - Receive Items', async ({ page }) => { | ||||
|   await page.getByRole('cell', { name: 'my-batch-code' }).first().waitFor(); | ||||
|   await page.getByRole('cell', { name: 'bucket' }).first().waitFor(); | ||||
| }); | ||||
|  | ||||
| test('Purchase Orders - Duplicate', async ({ page }) => { | ||||
|   await doQuickLogin(page); | ||||
|  | ||||
|   await navigate(page, 'purchasing/purchase-order/13/detail'); | ||||
|   await page.getByLabel('action-menu-order-actions').click(); | ||||
|   await page.getByLabel('action-menu-order-actions-duplicate').click(); | ||||
|  | ||||
|   // Ensure a new reference is suggested | ||||
|   await expect(page.getByLabel('text-field-reference')).not.toBeEmpty(); | ||||
|  | ||||
|   // Submit the duplicate request and ensure it completes | ||||
|   await page.getByRole('button', { name: 'Submit' }).isEnabled(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|   await page.getByRole('tab', { name: 'Order Details' }).waitFor(); | ||||
|   await page.getByRole('tab', { name: 'Order Details' }).click(); | ||||
|  | ||||
|   await page.getByText('Pending').first().waitFor(); | ||||
| }); | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| import { expect } from '@playwright/test'; | ||||
| import { test } from '../baseFixtures.ts'; | ||||
| import { | ||||
|   clearTableFilters, | ||||
| @@ -199,3 +200,22 @@ test('Sales Orders - Shipments', async ({ page }) => { | ||||
|     .first() | ||||
|     .click(); | ||||
| }); | ||||
|  | ||||
| test('Sales Orders - Duplicate', async ({ page }) => { | ||||
|   await doQuickLogin(page); | ||||
|  | ||||
|   await navigate(page, 'sales/sales-order/11/detail'); | ||||
|   await page.getByLabel('action-menu-order-actions').click(); | ||||
|   await page.getByLabel('action-menu-order-actions-duplicate').click(); | ||||
|  | ||||
|   // Ensure a new reference is suggested | ||||
|   await expect(page.getByLabel('text-field-reference')).not.toBeEmpty(); | ||||
|  | ||||
|   // Submit the duplicate request and ensure it completes | ||||
|   await page.getByRole('button', { name: 'Submit' }).isEnabled(); | ||||
|   await page.getByRole('button', { name: 'Submit' }).click(); | ||||
|   await page.getByRole('tab', { name: 'Order Details' }).waitFor(); | ||||
|   await page.getByRole('tab', { name: 'Order Details' }).click(); | ||||
|  | ||||
|   await page.getByText('Pending').first().waitFor(); | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user