Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PUI] Fix for stock item edit #8451

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/frontend/src/pages/stock/StockDetail.tsx
Original file line number Diff line number Diff line change
@@ -536,6 +536,7 @@ export default function StockDetail() {

const editStockItemFields = useStockFields({
create: false,
stockItem: stockitem,
partId: stockitem.part
});

7 changes: 5 additions & 2 deletions src/frontend/src/tables/stock/StockItemTable.tsx
Original file line number Diff line number Diff line change
@@ -414,12 +414,15 @@ export function StockItemTable({
};
}, [table]);

const stockItemFields = useStockFields({ create: true, partId: params.part });
const newStockItemFields = useStockFields({
create: true,
partId: params.part
});

const newStockItem = useCreateApiFormModal({
url: ApiEndpoints.stock_item_list,
title: t`Add Stock Item`,
fields: stockItemFields,
fields: newStockItemFields,
initialData: {
part: params.part,
location: params.location

Unchanged files with check annotations Beta

import { test } from '../baseFixtures';

Check failure on line 1 in src/frontend/tests/pages/pui_part.spec.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_part.spec.ts:129:1 › Parts - Pricing (Nothing

1) [chromium] › pages/pui_part.spec.ts:129:1 › Parts - Pricing (Nothing, BOM) ──────────────────── Test timeout of 90000ms exceeded.

Check failure on line 1 in src/frontend/tests/pages/pui_part.spec.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_part.spec.ts:204:1 › Parts - Pricing (Variant)

2) [chromium] › pages/pui_part.spec.ts:204:1 › Parts - Pricing (Variant) ───────────────────────── Test timeout of 90000ms exceeded.
import { baseUrl } from '../defaults';
import { doQuickLogin } from '../login';
await page.getByRole('button', { name: 'Pricing Overview' }).waitFor();
await page.getByText('Last Updated').waitFor();
await page.getByRole('button', { name: 'Internal Pricing' }).isDisabled();
await page.getByRole('button', { name: 'Sale History' }).isDisabled();

Check failure on line 151 in src/frontend/tests/pages/pui_part.spec.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_part.spec.ts:129:1 › Parts - Pricing (Nothing

1) [chromium] › pages/pui_part.spec.ts:129:1 › Parts - Pricing (Nothing, BOM) ──────────────────── Error: locator.isDisabled: Test timeout of 90000ms exceeded. Call log: - waiting for getByRole('button', { name: 'Sale History' }) 149 | await page.getByText('Last Updated').waitFor(); 150 | await page.getByRole('button', { name: 'Internal Pricing' }).isDisabled(); > 151 | await page.getByRole('button', { name: 'Sale History' }).isDisabled(); | ^ 152 | await page.getByRole('button', { name: 'Sale Pricing' }).isDisabled(); 153 | await page.getByRole('button', { name: 'BOM Pricing' }).isEnabled(); 154 | at /home/runner/work/InvenTree/InvenTree/src/frontend/tests/pages/pui_part.spec.ts:151:60
await page.getByRole('button', { name: 'Sale Pricing' }).isDisabled();
await page.getByRole('button', { name: 'BOM Pricing' }).isEnabled();
await page.goto(`${url}/login/?login=${username}&password=${password}`);
await page.waitForURL('**/platform/home');
await page.getByText(/InvenTree Demo Server/).waitFor();

Check failure on line 37 in src/frontend/tests/login.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_part.spec.ts:204:1 › Parts - Pricing (Variant)

2) [chromium] › pages/pui_part.spec.ts:204:1 › Parts - Pricing (Variant) ───────────────────────── Error: locator.waitFor: Test timeout of 90000ms exceeded. Call log: - waiting for getByText(/InvenTree Demo Server/) to be visible at login.ts:37 35 | await page.waitForURL('**/platform/home'); 36 | > 37 | await page.getByText(/InvenTree Demo Server/).waitFor(); | ^ 38 | }; 39 | 40 | export const doLogout = async (page) => { at doQuickLogin (/home/runner/work/InvenTree/InvenTree/src/frontend/tests/login.ts:37:49) at /home/runner/work/InvenTree/InvenTree/src/frontend/tests/pages/pui_part.spec.ts:205:3

Check failure on line 37 in src/frontend/tests/login.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_purchase_order.spec.ts:4:1 › Purchase Orders - General

3) [chromium] › pages/pui_purchase_order.spec.ts:4:1 › Purchase Orders - General ───────────────── Error: locator.waitFor: Test timeout of 90000ms exceeded. Call log: - waiting for getByText(/InvenTree Demo Server/) to be visible at login.ts:37 35 | await page.waitForURL('**/platform/home'); 36 | > 37 | await page.getByText(/InvenTree Demo Server/).waitFor(); | ^ 38 | }; 39 | 40 | export const doLogout = async (page) => { at doQuickLogin (/home/runner/work/InvenTree/InvenTree/src/frontend/tests/login.ts:37:49) at /home/runner/work/InvenTree/InvenTree/src/frontend/tests/pages/pui_purchase_order.spec.ts:5:3
};
export const doLogout = async (page) => {
import { test } from '../baseFixtures.ts';

Check failure on line 1 in src/frontend/tests/pages/pui_purchase_order.spec.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_purchase_order.spec.ts:4:1 › Purchase Orders - General

3) [chromium] › pages/pui_purchase_order.spec.ts:4:1 › Purchase Orders - General ───────────────── Test timeout of 90000ms exceeded.
import { doQuickLogin } from '../login.ts';
test('Purchase Orders - General', async ({ page }) => {
import { test } from '../baseFixtures.js';

Check failure on line 1 in src/frontend/tests/pages/pui_stock.spec.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_stock.spec.ts:118:1 › Stock - Stock Actions

4) [chromium] › pages/pui_stock.spec.ts:118:1 › Stock - Stock Actions ──────────────────────────── Test timeout of 90000ms exceeded.
import { baseUrl } from '../defaults.js';
import { doQuickLogin } from '../login.js';
await page.getByLabel('action-menu-stock-operations-add').waitFor();
await page.getByLabel('action-menu-stock-operations-remove').waitFor();
await page.getByLabel('action-menu-stock-operations-transfer').click();
await page.getByLabel('text-field-notes').fill('test notes');

Check failure on line 146 in src/frontend/tests/pages/pui_stock.spec.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_stock.spec.ts:118:1 › Stock - Stock Actions

4) [chromium] › pages/pui_stock.spec.ts:118:1 › Stock - Stock Actions ──────────────────────────── Error: locator.fill: Test timeout of 90000ms exceeded. Call log: - waiting for getByLabel('text-field-notes') 144 | await page.getByLabel('action-menu-stock-operations-remove').waitFor(); 145 | await page.getByLabel('action-menu-stock-operations-transfer').click(); > 146 | await page.getByLabel('text-field-notes').fill('test notes'); | ^ 147 | await page.getByRole('button', { name: 'Submit' }).click(); 148 | await page.getByText('This field is required.').first().waitFor(); 149 | await page.getByRole('button', { name: 'Cancel' }).click(); at /home/runner/work/InvenTree/InvenTree/src/frontend/tests/pages/pui_stock.spec.ts:146:45
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('This field is required.').first().waitFor();
await page.getByRole('button', { name: 'Cancel' }).click();
messages.push(msg);
});
await use(page);
expect(messages).toEqual([]);

Check failure on line 85 in src/frontend/tests/baseFixtures.ts

GitHub Actions / Tests - Platform UI

[chromium] › pages/pui_stock.spec.ts:118:1 › Stock - Stock Actions

4) [chromium] › pages/pui_stock.spec.ts:118:1 › Stock - Stock Actions ──────────────────────────── Error: expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 352 - Array [] + Array [ + ConsoleMessage { + "_event": Object { + "args": Array [], + "location": Object { + "columnNumber": 0, + "lineNumber": 0, + "url": "http://localhost:8000/api/stock/transfer/", + }, + "page": EventEmitter { + "_events": Object { + "bindingCall": [Function anonymous], + "close": [Function anonymous], + "crash": [Function anonymous], + "download": [Function anonymous], + "fileChooser": [Function anonymous], + "frameAttached": [Function anonymous], + "frameDetached": [Function anonymous], + "locatorHandlerTriggered": [Function anonymous], + "route": [Function anonymous], + "video": [Function anonymous], + "webSocket": [Function anonymous], + "worker": [Function anonymous], + }, + "_eventsCount": 12, + "_maxListeners": undefined, + "_object": Object { + "_guid": "page@79f61da4530209abd368e24eb95b8a61", + "_type": "Page", + }, + "_pendingHandlers": Map {}, + "_rejectionHandler": undefined, + "off": [Function removeListener], + "on": [Function addListener], + }, + "text": "Failed to load resource: the server responded with a status of 401 (Unauthorized)", + "type": "error", + }, + "_page": Object { + "_guid": "page@79f61da4530209abd368e24eb95b8a61", + "_type": "Page", + }, + }, + ConsoleMessage { + "_event": Object { + "args": Array [], + "location": Object { + "columnNumber": 0, + "lineNumber": 0, + "url": "http://localhost:8000/api/stock/transfer/", + }, + "page": EventEmitter { + "_events": Object { + "bindingCall": [Function anonymous], + "close": [Function anonymous], + "crash": [Function anonymous], + "download": [Function anonymous], + "fileChooser": [Function anonymous], + "frameAttached": [Function anonymous], + "frameDetached": [Function anonymous], + "locatorHandlerTriggered": [Function anonymous], + "route": [Function anonymous], + "video": [Function anonymous], + "webSocket": [Function anonymous], + "worker": [Function anonymous], + }, + "_eventsCount": 12, + "_maxListeners": undefined, + "_object": Object { + "_guid": "page@79f61da4530209abd368e24eb95b8a61", + "_type": "Page", + }, + "_pendingHandlers": Map {}, + "_rejectionHandler": undefined, + "off": [Function removeListener], + "on": [Function addListener], + }, + "text": "Failed to load resource: the server responded with a status of 401 (Unauthorized)", + "type": "error", + }, + "_page": Object { + "_guid": "page@79f61da4530209abd368e24eb95b8a61", + "_type": "Page", + }, + }, + ConsoleMessage { + "_event": Object { + "args": Array [], + "location": Object { + "columnNumber": 0, + "lineNumber": 0, + "url": "http://localhost:8000/api/stock/transfer/", + }, + "page": EventEmitter { + "_events": Object { + "bindingCall": [Function anonymous], + "close": [Function anonymous], + "crash": [Function anonymous], + "download
}
});
import test from 'playwright/test';

Check failure on line 1 in src/frontend/tests/pui_plugins.spec.ts

GitHub Actions / Tests - Platform UI

[firefox] › pui_plugins.spec.ts:67:1 › Plugins - Custom Admin

5) [firefox] › pui_plugins.spec.ts:67:1 › Plugins - Custom Admin ───────────────────────────────── Test timeout of 90000ms exceeded.
import { baseUrl } from './defaults.js';
import { doQuickLogin } from './login.js';