mirror of
https://github.com/inventree/InvenTree.git
synced 2025-11-30 01:10:00 +00:00
[UI] Fix for PartTestResultTable (#10886)
* [UI] Fix for PartTestResultTable - Filter properly by part instance * Add a simple unit test * Tweak unit test
This commit is contained in:
@@ -26,7 +26,7 @@ import { formatDate } from '../../defaults/formatters';
|
|||||||
import { useTestResultFields } from '../../forms/StockForms';
|
import { useTestResultFields } from '../../forms/StockForms';
|
||||||
import { useCreateApiFormModal } from '../../hooks/UseForm';
|
import { useCreateApiFormModal } from '../../hooks/UseForm';
|
||||||
import { useTable } from '../../hooks/UseTable';
|
import { useTable } from '../../hooks/UseTable';
|
||||||
import { LocationColumn } from '../ColumnRenderers';
|
import { LocationColumn, PartColumn } from '../ColumnRenderers';
|
||||||
import {
|
import {
|
||||||
BatchFilter,
|
BatchFilter,
|
||||||
HasBatchCodeFilter,
|
HasBatchCodeFilter,
|
||||||
@@ -243,6 +243,14 @@ export default function PartTestResultTable({
|
|||||||
const tableColumns: TableColumn[] = useMemo(() => {
|
const tableColumns: TableColumn[] = useMemo(() => {
|
||||||
// Fixed columns
|
// Fixed columns
|
||||||
const columns: TableColumn[] = [
|
const columns: TableColumn[] = [
|
||||||
|
PartColumn({
|
||||||
|
title: t`Part`,
|
||||||
|
part: 'part_detail',
|
||||||
|
full_name: true,
|
||||||
|
ordering: 'part',
|
||||||
|
sortable: true,
|
||||||
|
switchable: true
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
accessor: 'stock',
|
accessor: 'stock',
|
||||||
title: t`Stock Item`,
|
title: t`Stock Item`,
|
||||||
@@ -354,6 +362,7 @@ export default function PartTestResultTable({
|
|||||||
part_detail: true,
|
part_detail: true,
|
||||||
location_detail: true,
|
location_detail: true,
|
||||||
tests: true,
|
tests: true,
|
||||||
|
part: partId,
|
||||||
build: buildId
|
build: buildId
|
||||||
},
|
},
|
||||||
enableSelection: true,
|
enableSelection: true,
|
||||||
|
|||||||
@@ -581,6 +581,15 @@ test('Parts - Parameter Filtering', async ({ browser }) => {
|
|||||||
await page.getByText(/\/ 42\d/).waitFor();
|
await page.getByText(/\/ 42\d/).waitFor();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Parts - Test Results', async ({ browser }) => {
|
||||||
|
const page = await doCachedLogin(browser, { url: '/part/74/test_results' });
|
||||||
|
|
||||||
|
await page.waitForTimeout(2500);
|
||||||
|
|
||||||
|
await page.getByText(/1 - \d+ \/ 1\d\d/).waitFor();
|
||||||
|
await page.getByText('Blue Paint Applied').waitFor();
|
||||||
|
});
|
||||||
|
|
||||||
test('Parts - Notes', async ({ browser }) => {
|
test('Parts - Notes', async ({ browser }) => {
|
||||||
const page = await doCachedLogin(browser, { url: 'part/69/notes' });
|
const page = await doCachedLogin(browser, { url: 'part/69/notes' });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user