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

[UI] Hide top level tree panels (#11799)

* Hide "top level stock location" panel

Co-authored-by: Copilot <copilot@github.com>

* Hide "top level part category"

Co-authored-by: Copilot <copilot@github.com>

* Adjust playwright tests

* Improve robustness of test

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Oliver
2026-04-26 07:16:06 +10:00
committed by GitHub
parent 2129e3338a
commit e684e002f7
4 changed files with 19 additions and 31 deletions
+10 -15
View File
@@ -15,9 +15,6 @@ test('Stock - Basic Tests', async ({ browser }) => {
await page.waitForURL('**/web/stock/location/**');
await loadTab(page, 'Location Details');
await page.waitForURL('**/web/stock/location/index/details');
await loadTab(page, 'Stock Items');
await page.getByText('1551ABK').first().click();
@@ -62,7 +59,6 @@ test('Stock - Location Tree', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'stock/location/index/' });
await page.waitForURL('**/web/stock/location/**');
await loadTab(page, 'Location Details');
await page.getByLabel('nav-breadcrumb-action').click();
await page.getByLabel('nav-tree-toggle-1}').click();
@@ -79,13 +75,14 @@ test('Stock - Location Delete', async ({ browser }) => {
url: 'stock/location/38/sublocations'
});
const loc_1 = `loc-1-${Math.floor(Math.random() * 1000)}`;
const loc_2 = `loc-2-${Math.floor(Math.random() * 1000)}`;
// Create a sub-location
await page
.getByRole('button', { name: 'action-button-add-stock-location' })
.click();
await page
.getByRole('textbox', { name: 'text-field-name' })
.fill('my-location-1');
await page.getByRole('textbox', { name: 'text-field-name' }).fill(loc_1);
await page.getByRole('button', { name: 'Submit' }).click();
// Create a secondary sub-location
@@ -93,22 +90,20 @@ test('Stock - Location Delete', async ({ browser }) => {
await page
.getByRole('button', { name: 'action-button-add-stock-location' })
.click();
await page
.getByRole('textbox', { name: 'text-field-name' })
.fill('my-location-2');
await page.getByRole('textbox', { name: 'text-field-name' }).fill(loc_2);
await page.getByRole('button', { name: 'Submit' }).click();
// Navigate up to parent
await page.getByRole('link', { name: 'breadcrumb-2-my-location-1' }).click();
await page.getByRole('link', { name: `breadcrumb-2-${loc_1}` }).click();
await loadTab(page, 'Sublocations');
await page
.getByRole('cell', { name: 'my-location-2', exact: true })
.waitFor();
await page.getByRole('cell', { name: loc_2, exact: true }).waitFor();
// Delete this location, and all child locations
await page
.locator('div')
.filter({ hasText: /^Stock>PCB Assembler>my-location-1Stock Location$/ })
.filter({
hasText: new RegExp(`^Stock>PCB Assembler>${loc_1}Stock Location$`)
})
.getByLabel('action-menu-location-actions')
.click();
await page
@@ -65,7 +65,6 @@ test('Permissions - Reader', async ({ browser }) => {
url: '/part/category/index/'
});
await loadTab(page, 'Category Details');
await loadTab(page, 'Parts');
// Navigate to a specific part