2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-15 07:48:51 +00:00

[UI Update image fix (#11557)

* Improve thumbnail selector

- Center image
- Better descriptive text

* Updated playwrigth testing
This commit is contained in:
Oliver
2026-03-19 16:56:13 +11:00
committed by GitHub
parent 16103379c9
commit 4599edd375
3 changed files with 56 additions and 7 deletions

View File

@@ -65,6 +65,38 @@ test('Parts - Tabs', async ({ browser }) => {
await loadTab(page, 'Build Orders');
});
test('Parts - Image Selection', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/911/details' });
// Select a new image from the available images
await page
.getByRole('tabpanel', { name: 'Part Details' })
.locator('img')
.hover();
await page
.getByRole('button', { name: 'action-button-select-from-' })
.click();
await page.getByRole('textbox', { name: 'part-thumb-search' }).fill('red');
await page
.locator('div')
.filter({ hasText: /^chair_red\.png \(1\)$/ })
.nth(1)
.click();
await page.getByRole('button', { name: 'Select' }).click();
await page.getByText('The image has been updated successfully').waitFor();
// Now remove the associated image
await page
.getByRole('tabpanel', { name: 'Part Details' })
.locator('img')
.hover();
await page
.getByRole('button', { name: 'action-button-delete-image' })
.click();
await page.getByRole('button', { name: 'Remove' }).click();
await page.getByText('The image has been removed successfully').waitFor();
});
test('Parts - Manufacturer Parts', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'part/84/' });