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
3 changes: 2 additions & 1 deletion modules/ui/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ <h1 class="main-heading">Testrun</h1>
vm.hasConnectionSettings === true &&
vm.hasDevices &&
(!vm.systemStatus || vm.systemStatus === StatusOfTestrun.Idle) &&
vm.isStatusLoaded === true
vm.isStatusLoaded === true &&
!vm.reports.length
">
Step 3: Once device is created, you are able to
<a
Expand Down
11 changes: 11 additions & 0 deletions modules/ui/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import { CertificatesComponent } from './pages/certificates/certificates.compone
import { of } from 'rxjs';
import { WINDOW } from './providers/window.provider';
import { LiveAnnouncer } from '@angular/cdk/a11y';
import { HISTORY } from './mocks/reports.mock';

const windowMock = {
location: {
Expand Down Expand Up @@ -489,6 +490,16 @@ describe('AppComponent', () => {
expect(callout).toBeTruthy();
expect(calloutContent).toContain('Step 3');
});

it('should NOT have callout component with "Step 3" if has reports', () => {
store.overrideSelector(selectReports, [...HISTORY]);
store.refreshState();
fixture.detectChanges();

const callout = compiled.querySelector('app-callout');

expect(callout).toBeFalsy();
});
});

describe('with systemStatus data IN Progress and without riskProfiles', () => {
Expand Down
3 changes: 3 additions & 0 deletions modules/ui/src/app/app.store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
selectInterfaces,
selectIsOpenWaitSnackBar,
selectMenuOpened,
selectReports,
selectStatus,
selectTestModules,
} from './store/selectors';
Expand Down Expand Up @@ -103,6 +104,7 @@ describe('AppStore', () => {

store.overrideSelector(selectHasDevices, true);
store.overrideSelector(selectHasRiskProfiles, false);
store.overrideSelector(selectReports, []);
store.overrideSelector(selectHasConnectionSettings, true);
store.overrideSelector(selectMenuOpened, true);
store.overrideSelector(selectInterfaces, {});
Expand Down Expand Up @@ -147,6 +149,7 @@ describe('AppStore', () => {
consentShown: false,
hasDevices: true,
hasRiskProfiles: false,
reports: [],
isStatusLoaded: false,
systemStatus: null,
hasConnectionSettings: true,
Expand Down
3 changes: 3 additions & 0 deletions modules/ui/src/app/app.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
selectHasRiskProfiles,
selectInterfaces,
selectMenuOpened,
selectReports,
selectStatus,
} from './store/selectors';
import { Store } from '@ngrx/store';
Expand Down Expand Up @@ -55,6 +56,7 @@ export class AppStore extends ComponentStore<AppComponentState> {
private isStatusLoaded$ = this.select(state => state.isStatusLoaded);
private hasDevices$ = this.store.select(selectHasDevices);
private hasRiskProfiles$ = this.store.select(selectHasRiskProfiles);
private reports$ = this.store.select(selectReports);
private hasConnectionSetting$ = this.store.select(
selectHasConnectionSettings
);
Expand All @@ -69,6 +71,7 @@ export class AppStore extends ComponentStore<AppComponentState> {
consentShown: this.consentShown$,
hasDevices: this.hasDevices$,
hasRiskProfiles: this.hasRiskProfiles$,
reports: this.reports$,
isStatusLoaded: this.isStatusLoaded$,
systemStatus: this.systemStatus$,
hasConnectionSettings: this.hasConnectionSetting$,
Expand Down