mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-27 14:16:02 +00:00
Test result bug (#12918)
* [UI] Fix for test results * Display all results in expanded table row * Fix uni ttest
This commit is contained in:
@@ -113,7 +113,13 @@ export default function StockItemTestResultTable({
|
||||
// Iterate through the returned records
|
||||
// Sort test results using the same priority as the backend:
|
||||
// finished_datetime -> started_datetime -> date -> pk
|
||||
records.toSorted(compareTestResults).forEach((record) => {
|
||||
// Note: compareTestResults sorts newest-first, but we need to iterate
|
||||
// oldest-first here, so that the most recent result is processed last
|
||||
// and ends up displayed as the primary result for its template.
|
||||
records
|
||||
.toSorted(compareTestResults)
|
||||
.toReversed()
|
||||
.forEach((record) => {
|
||||
// Find matching template
|
||||
const idx = results.findIndex(
|
||||
(r: any) => r.templateId == record.template
|
||||
@@ -464,7 +470,7 @@ export default function StockItemTestResultTable({
|
||||
return null;
|
||||
}
|
||||
|
||||
const results = record?.results ?? [];
|
||||
const results = record?.results?.toReversed() ?? [];
|
||||
|
||||
return (
|
||||
<DataTable
|
||||
@@ -472,7 +478,7 @@ export default function StockItemTestResultTable({
|
||||
idAccessor={'test'}
|
||||
noHeader
|
||||
columns={cols}
|
||||
records={results.slice(0, -1)}
|
||||
records={results}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -441,12 +441,19 @@ test('Settings - Admin - Parameter', async ({ browser }) => {
|
||||
await loadTab(page, 'Selection Lists');
|
||||
|
||||
// Check for expected entry
|
||||
await page
|
||||
.getByRole('textbox', { name: 'table-search-input' })
|
||||
.fill('Animals');
|
||||
await page.getByRole('cell', { name: 'Animals', exact: true }).waitFor();
|
||||
await page.getByText('Various animals and descriptions thereof').waitFor();
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForTimeout(250);
|
||||
|
||||
await page.getByRole('textbox', { name: 'table-search-input' }).fill('some');
|
||||
await page.waitForTimeout(500);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
// Clean old list data if exists
|
||||
await page
|
||||
.getByRole('cell', { name: 'some list' })
|
||||
|
||||
Reference in New Issue
Block a user