Skip to content
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
6 changes: 6 additions & 0 deletions modules/ui/src/app/mocks/testrun.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ export const MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE: TestrunStatus = {
started: null,
};

export const MOCK_PROGRESS_DATA_STARTING: TestrunStatus = {
...MOCK_PROGRESS_DATA_IN_PROGRESS,
status: StatusOfTestrun.Starting,
started: null,
};

export const MOCK_PROGRESS_DATA_VALIDATING: TestrunStatus = {
...MOCK_PROGRESS_DATA_IN_PROGRESS,
status: StatusOfTestrun.Validating,
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/model/testrun-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export enum StatusOfTestrun {
SmartReady = 'Smart Ready', // used for Completed
Idle = 'Idle',
Monitoring = 'Monitoring',
Starting = 'Starting',
Error = 'Error',
Validating = 'Validating Network',
Proceed = 'Proceed',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class TestrunStatusCardComponent {
status === StatusOfTestrun.Monitoring ||
status === StatusOfTestrun.InProgress ||
status === StatusOfTestrun.WaitingForDevice ||
status === StatusOfTestrun.Starting ||
status === StatusOfTestrun.Validating
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export class TestrunTableComponent {
}

public getRequiredResultClass(result: string): string {
if (!result) {
return '';
}
return result.split(' ').join('-').toLowerCase();
}

Expand Down
16 changes: 16 additions & 0 deletions modules/ui/src/app/pages/testrun/testrun.store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
MOCK_PROGRESS_DATA_VALIDATING,
TEST_DATA_RESULT_WITH_RECOMMENDATIONS,
TEST_DATA_TABLE_RESULT,
MOCK_PROGRESS_DATA_STARTING,
} from '../../mocks/testrun.mock';
import { LoaderService } from '../../services/loader.service';

Expand Down Expand Up @@ -187,6 +188,21 @@ describe('TestrunStore', () => {
});
});

it('should set value with empty values for status "Starting"', done => {
const expectedResult = EMPTY_RESULT;

store.overrideSelector(
selectSystemStatus,
MOCK_PROGRESS_DATA_STARTING
);
store.refreshState();

testrunStore.viewModel$.pipe(take(1)).subscribe(store => {
expect(store.dataSource).toEqual(expectedResult);
done();
});
});

it('should set value with empty values for status "Cancelled" and empty result', done => {
const expectedResult = EMPTY_RESULT;

Expand Down
3 changes: 3 additions & 0 deletions modules/ui/src/app/pages/testrun/testrun.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export class TestrunStore extends ComponentStore<TestrunComponentState> {
if (
res?.status === StatusOfTestrun.Validating ||
res?.status === StatusOfTestrun.WaitingForDevice ||
res?.status === StatusOfTestrun.Starting ||
res?.status === StatusOfTestrun.Monitoring ||
(res?.status === StatusOfTestrun.InProgress &&
this.resultIsEmpty(res.tests))
Expand All @@ -123,6 +124,7 @@ export class TestrunStore extends ComponentStore<TestrunComponentState> {
res?.status === StatusOfTestrun.Validating ||
res?.status === StatusOfTestrun.Monitoring ||
res?.status === StatusOfTestrun.WaitingForDevice ||
res?.status === StatusOfTestrun.Starting ||
(res?.status === StatusOfTestrun.Cancelled && !results.length)
) {
this.setDataSource(EMPTY_RESULT);
Expand Down Expand Up @@ -210,6 +212,7 @@ export class TestrunStore extends ComponentStore<TestrunComponentState> {
return (
status === StatusOfTestrun.InProgress ||
status === StatusOfTestrun.WaitingForDevice ||
status === StatusOfTestrun.Starting ||
status === StatusOfTestrun.Monitoring ||
status === StatusOfTestrun.Validating
);
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/services/test-run.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ describe('TestRunService', () => {
const resultsInProgress = [
StatusOfTestrun.InProgress,
StatusOfTestrun.WaitingForDevice,
StatusOfTestrun.Starting,
StatusOfTestrun.Monitoring,
StatusOfTestrun.Validating,
];
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/services/test-run.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export class TestRunService {
return (
status === StatusOfTestrun.InProgress ||
status === StatusOfTestrun.WaitingForDevice ||
status === StatusOfTestrun.Starting ||
status === StatusOfTestrun.Monitoring ||
status === StatusOfTestrun.Validating
);
Expand Down
Loading