2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

[PUI] Edit shortcut (#7870)

* Adds shortcut to edit item on <PageDetail>

* Add hooks for shortcut key

* Add unit tests for edit shortcut
This commit is contained in:
Oliver
2024-08-14 20:12:51 +10:00
committed by GitHub
parent e1b0efaa12
commit 19ca7bffae
14 changed files with 55 additions and 1 deletions

View File

@ -19,6 +19,13 @@ test('PUI - Pages - Build Order', async ({ page }) => {
// This build order should be "on hold"
await page.getByText('On Hold').first().waitFor();
// Edit the build order (via keyboard shortcut)
await page.keyboard.press('Control+E');
await page.getByLabel('text-field-title').waitFor();
await page.getByLabel('related-field-project_code').waitFor();
await page.getByRole('button', { name: 'Cancel' }).click();
await page.getByRole('button', { name: 'Issue Order' }).click();
await page.getByRole('button', { name: 'Cancel' }).click();

View File

@ -226,6 +226,15 @@ test('PUI - Pages - Part - Notes', async ({ page }) => {
await page.goto(`${baseUrl}/part/69/notes`);
// Enable editing
await page.getByLabel('toggle-notes-editing').waitFor();
// Use keyboard shortcut to "edit" the part
await page.keyboard.press('Control+E');
await page.getByLabel('text-field-name').waitFor();
await page.getByLabel('text-field-description').waitFor();
await page.getByLabel('related-field-category').waitFor();
await page.getByRole('button', { name: 'Cancel' }).click();
await page.getByLabel('toggle-notes-editing').click();
// Enter some text