Add e2e test for editing pick lists

This commit is contained in:
beatz174-bit
2025-11-24 08:10:11 +10:00
parent 345b9bceb1
commit 185be8f7bb
+32
View File
@@ -27,6 +27,38 @@ test.describe('Active pick list', () => {
await expect(page.getByRole('button', { name: 'Save and Return' })).toBeEnabled();
});
test('adds a product to an existing pick list from the search input', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'StockFill' })).toBeVisible();
await page.getByRole('link', { name: 'Create Pick List' }).click();
await page.getByLabel('Area').click();
await page.getByRole('option', { name: areaName }).first().click();
await page.getByRole('button', { name: 'Save Pick List' }).click();
await expect(page.getByRole('heading', { name: `${areaName} List` })).toBeVisible();
await page.getByRole('button', { name: 'Save and Return' }).click();
await expect(page.getByRole('heading', { name: 'Pick Lists' })).toBeVisible();
await page.getByRole('link', { name: new RegExp(areaName, 'i') }).click();
await expect(page.getByRole('heading', { name: `${areaName} List` })).toBeVisible();
const searchInput = page.getByPlaceholder('Search products');
await searchInput.click();
await searchInput.fill(additionalProduct);
const productOption = page.getByRole('option', {
name: new RegExp(`${additionalProduct} \\(${areaName}\\)`, 'i'),
});
await expect(productOption).toBeVisible();
await productOption.click();
await expect(page.getByText(additionalProduct).first()).toBeVisible();
await expect(page.getByText(/Qty:\s*1\s+unit/i)).toBeVisible();
});
test('allows adding and editing products from the manage products screen', async ({ page }) => {
await page.goto('/');