Test result bug (#12918)

* [UI] Fix for test results

* Display all results in expanded table row

* Fix uni ttest
This commit is contained in:
Oliver
2026-09-23 22:09:50 +09:30
committed by GitHub
parent a4518fb52b
commit 63f81714fb
2 changed files with 28 additions and 15 deletions
@@ -113,7 +113,13 @@ export default function StockItemTestResultTable({
// Iterate through the returned records // Iterate through the returned records
// Sort test results using the same priority as the backend: // Sort test results using the same priority as the backend:
// finished_datetime -> started_datetime -> date -> pk // 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 // Find matching template
const idx = results.findIndex( const idx = results.findIndex(
(r: any) => r.templateId == record.template (r: any) => r.templateId == record.template
@@ -464,7 +470,7 @@ export default function StockItemTestResultTable({
return null; return null;
} }
const results = record?.results ?? []; const results = record?.results?.toReversed() ?? [];
return ( return (
<DataTable <DataTable
@@ -472,7 +478,7 @@ export default function StockItemTestResultTable({
idAccessor={'test'} idAccessor={'test'}
noHeader noHeader
columns={cols} columns={cols}
records={results.slice(0, -1)} records={results}
/> />
); );
} }
+7
View File
@@ -441,12 +441,19 @@ test('Settings - Admin - Parameter', async ({ browser }) => {
await loadTab(page, 'Selection Lists'); await loadTab(page, 'Selection Lists');
// Check for expected entry // 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.getByRole('cell', { name: 'Animals', exact: true }).waitFor();
await page.getByText('Various animals and descriptions thereof').waitFor(); await page.getByText('Various animals and descriptions thereof').waitFor();
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await page.waitForTimeout(250); 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 // Clean old list data if exists
await page await page
.getByRole('cell', { name: 'some list' }) .getByRole('cell', { name: 'some list' })