From 310e81626b41452b9083f2681de71a133df3c451 Mon Sep 17 00:00:00 2001 From: kurilova Date: Wed, 13 Mar 2024 11:33:23 +0000 Subject: [PATCH] Save expand/collapse state --- modules/ui/src/app/mocks/progress.mock.ts | 2 +- .../progress-table/progress-table.component.html | 2 +- .../progress-table/progress-table.component.spec.ts | 7 +++++++ .../components/progress-table/progress-table.component.ts | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/ui/src/app/mocks/progress.mock.ts b/modules/ui/src/app/mocks/progress.mock.ts index ad8687807..7d855bfd5 100644 --- a/modules/ui/src/app/mocks/progress.mock.ts +++ b/modules/ui/src/app/mocks/progress.mock.ts @@ -20,7 +20,7 @@ import { TestsData, } from '../model/testrun-status'; -const TEST_DATA_RESULT: IResult[] = [ +export const TEST_DATA_RESULT: IResult[] = [ { name: 'dns.network.hostname_resolution', description: 'The device should resolve hostnames', diff --git a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.html b/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.html index 6d5e45c84..ee80a6c9c 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.html +++ b/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.html @@ -33,7 +33,7 @@ - + { ); expect(result).toEqual(expectedResult); }); + + it('#trackTest should return name and status', () => { + expect(component.trackTest(1, TEST_DATA_RESULT[0])).toEqual( + 'dns.network.hostname_resolutionCompliant' + ); + }); }); describe('DOM tests', () => { diff --git a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts b/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts index 1d5597859..206a88f58 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts +++ b/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts @@ -73,4 +73,8 @@ export class ProgressTableComponent implements OnInit { const message = this.stepsToResolve?.length === 1 ? 'row' : 'all rows'; return `${action} ${message}`; } + + public trackTest(index: number, item: IResult) { + return item.name + item.result; + } }