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

Save expand/collapse state #330

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
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
Save expand/collapse state
  • Loading branch information
sofyakurilova committed Mar 13, 2024
commit 310e81626b41452b9083f2681de71a133df3c451
2 changes: 1 addition & 1 deletion modules/ui/src/app/mocks/progress.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</span>
</section>

<ng-container *ngFor="let item of dataSource">
<ng-container *ngFor="let item of dataSource; trackBy: trackTest">
<mat-expansion-panel
*ngIf="item.recommendations; else simpleRow"
[expanded]="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { IResult, StatusOfTestResult } from '../../../../model/testrun-status';
import { of } from 'rxjs';
import {
TEST_DATA,
TEST_DATA_RESULT,
TEST_DATA_RESULT_WITH_RECOMMENDATIONS,
} from '../../../../mocks/progress.mock';
import { TestRunService } from '../../../../services/test-run.service';
Expand Down Expand Up @@ -67,6 +68,12 @@ describe('ProgressTableComponent', () => {
);
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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Loading