2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-28 13:54:25 +00:00

Generator updates (#10605)

* Form Field updates:

- Allow spec of leftSection prop
- Allow spec of rightSection prop

* Add ability to auto-fill text input with placeholder value

* Simplify stock form

* Better serial number placeholders

* Update other generator fields

* Add default placeholder to DateInput

* Enhance TextField

* Remove serial_numbers field for non-creation forms

* Update playwright tests

* Adjust playwright tests

* Further playwright adjustments

* Fix project code field for build serializer
This commit is contained in:
Oliver
2025-10-18 17:18:04 +11:00
committed by GitHub
parent a7c4f2adba
commit 72d127219f
16 changed files with 219 additions and 114 deletions
+16 -7
View File
@@ -130,7 +130,9 @@ test('Stock - Serial Numbers', async ({ browser }) => {
await page.getByLabel('action-button-add-stock-item').click();
// Initially fill with invalid serial/quantity combinations
await page.getByLabel('text-field-serial_numbers').fill('200-250');
await page
.getByLabel('text-field-serial_numbers', { exact: true })
.fill('200-250');
await page.getByLabel('number-field-quantity').fill('10');
// Add delay to account to field debounce
@@ -171,7 +173,7 @@ test('Stock - Serial Navigation', async ({ browser }) => {
await page.getByLabel('action-menu-stock-actions').click();
await page.getByLabel('action-menu-stock-actions-search').click();
await page.getByLabel('text-field-serial').fill('359');
await page.getByLabel('text-field-serial', { exact: true }).fill('359');
await page.getByRole('button', { name: 'Submit' }).click();
// Start at serial 359
@@ -183,7 +185,7 @@ test('Stock - Serial Navigation', async ({ browser }) => {
await page.getByText('358', { exact: true }).first().waitFor();
await page.getByLabel('action-button-find-serial').click();
await page.getByLabel('text-field-serial').fill('200');
await page.getByLabel('text-field-serial', { exact: true }).fill('200');
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Serial Number: 200').waitFor();
@@ -201,10 +203,15 @@ test('Stock - Serialize', async ({ browser }) => {
// Check for expected placeholder value
await expect(
page.getByRole('textbox', { name: 'text-field-serial_numbers' })
).toHaveAttribute('placeholder', 'Next serial number: 365');
page.getByRole('textbox', {
name: 'text-field-serial_numbers',
exact: true
})
).toHaveAttribute('placeholder', '365+');
await page.getByLabel('text-field-serial_numbers').fill('200-250');
await page
.getByLabel('text-field-serial_numbers', { exact: true })
.fill('200-250');
await page.getByRole('button', { name: 'Submit' }).click();
@@ -212,7 +219,9 @@ test('Stock - Serialize', async ({ browser }) => {
.getByText('Number of unique serial numbers (51) must match quantity (100)')
.waitFor();
await page.getByLabel('text-field-serial_numbers').fill('1, 2, 3');
await page
.getByLabel('text-field-serial_numbers', { exact: true })
.fill('1, 2, 3');
await page.waitForTimeout(250);
await page.getByRole('button', { name: 'Submit' }).click();