2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-11-14 03:46:44 +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

View File

@@ -270,16 +270,20 @@ test('Settings - Admin', async ({ browser }) => {
await roomRow.getByLabel(/row-action-menu-/i).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await expect(page.getByLabel('text-field-name')).toHaveValue('Room');
await expect(page.getByLabel('text-field-name', { exact: true })).toHaveValue(
'Room'
);
// Toggle the "description" field
const oldDescription = await page
.getByLabel('text-field-description')
.getByLabel('text-field-description', { exact: true })
.inputValue();
const newDescription = `${oldDescription} (edited)`;
await page.getByLabel('text-field-description').fill(newDescription);
await page
.getByLabel('text-field-description', { exact: true })
.fill(newDescription);
await page.waitForTimeout(500);
await page.getByRole('button', { name: 'Submit' }).click();
@@ -293,19 +297,21 @@ test('Settings - Admin', async ({ browser }) => {
await boxRow.getByLabel(/row-action-menu-/i).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await expect(page.getByLabel('text-field-name')).toHaveValue('Box (Large)');
await expect(page.getByLabel('text-field-description')).toHaveValue(
'Large cardboard box'
await expect(page.getByLabel('text-field-name', { exact: true })).toHaveValue(
'Box (Large)'
);
await expect(
page.getByLabel('text-field-description', { exact: true })
).toHaveValue('Large cardboard box');
await page.getByRole('button', { name: 'Cancel' }).click();
// Edit first item again (revert values)
await roomRow.getByLabel(/row-action-menu-/i).click();
await page.getByRole('menuitem', { name: 'Edit' }).click();
await page.getByLabel('text-field-name').fill('Room');
await page.getByLabel('text-field-name', { exact: true }).fill('Room');
await page.waitForTimeout(500);
await page
.getByLabel('text-field-description')
.getByLabel('text-field-description', { exact: true })
.fill(newDescription.replaceAll(' (edited)', ''));
await page.waitForTimeout(500);
await page.getByRole('button', { name: 'Submit' }).click();