From e00af61e4477c13175ec43e8ddc010126212f405 Mon Sep 17 00:00:00 2001 From: kurilova Date: Fri, 24 May 2024 09:11:34 +0000 Subject: [PATCH 1/2] Rename testrun component --- modules/ui/src/app/app-routing.module.ts | 2 +- modules/ui/src/app/app.component.spec.ts | 2 +- modules/ui/src/app/app.store.spec.ts | 2 +- .../download-report-pdf.component.spec.ts | 2 +- .../download-report-zip.component.spec.ts | 2 +- .../download-report.component.spec.ts | 2 +- .../report-action.component.spec.ts | 2 +- .../{progress.mock.ts => testrun.mock.ts} | 0 .../pages/devices/devices.component.spec.ts | 6 ++--- .../app/pages/devices/devices.component.ts | 4 +-- .../delete-report.component.spec.ts | 2 +- .../download-options.component.spec.ts | 2 +- .../testrun-initiate-form.component.html} | 0 .../testrun-initiate-form.component.scss} | 0 .../testrun-initiate-form.component.spec.ts} | 12 ++++----- .../testrun-initiate-form.component.ts} | 10 +++---- .../testrun-status-card.component.html} | 0 .../testrun-status-card.component.scss} | 0 .../testrun-status-card.component.spec.ts} | 20 +++++++------- .../testrun-status-card.component.ts} | 8 +++--- .../testrun-table.component.html} | 0 .../testrun-table.component.scss} | 0 .../testrun-table.component.spec.ts} | 16 ++++++------ .../testrun-table.component.ts} | 8 +++--- ...ng.module.ts => testrun-routing.module.ts} | 6 ++--- ....component.html => testrun.component.html} | 8 +++--- ....component.scss => testrun.component.scss} | 0 ...nent.spec.ts => testrun.component.spec.ts} | 26 +++++++++---------- ...ress.component.ts => testrun.component.ts} | 10 +++---- .../{progress.module.ts => testrun.module.ts} | 22 ++++++++-------- .../app/pages/testrun/testrun.store.spec.ts | 2 +- .../src/app/services/test-run.service.spec.ts | 2 +- modules/ui/src/app/store/effects.spec.ts | 2 +- modules/ui/src/app/store/reducers.spec.ts | 2 +- 34 files changed, 91 insertions(+), 91 deletions(-) rename modules/ui/src/app/mocks/{progress.mock.ts => testrun.mock.ts} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-initiate-form/progress-initiate-form.component.html => testrun-initiate-form/testrun-initiate-form.component.html} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-initiate-form/progress-initiate-form.component.scss => testrun-initiate-form/testrun-initiate-form.component.scss} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-initiate-form/progress-initiate-form.component.spec.ts => testrun-initiate-form/testrun-initiate-form.component.spec.ts} (97%) rename modules/ui/src/app/pages/testrun/components/{progress-initiate-form/progress-initiate-form.component.ts => testrun-initiate-form/testrun-initiate-form.component.ts} (94%) rename modules/ui/src/app/pages/testrun/components/{progress-status-card/progress-status-card.component.html => testrun-status-card/testrun-status-card.component.html} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-status-card/progress-status-card.component.scss => testrun-status-card/testrun-status-card.component.scss} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-status-card/progress-status-card.component.spec.ts => testrun-status-card/testrun-status-card.component.spec.ts} (95%) rename modules/ui/src/app/pages/testrun/components/{progress-status-card/progress-status-card.component.ts => testrun-status-card/testrun-status-card.component.ts} (94%) rename modules/ui/src/app/pages/testrun/components/{progress-table/progress-table.component.html => testrun-table/testrun-table.component.html} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-table/progress-table.component.scss => testrun-table/testrun-table.component.scss} (100%) rename modules/ui/src/app/pages/testrun/components/{progress-table/progress-table.component.spec.ts => testrun-table/testrun-table.component.spec.ts} (90%) rename modules/ui/src/app/pages/testrun/components/{progress-table/progress-table.component.ts => testrun-table/testrun-table.component.ts} (92%) rename modules/ui/src/app/pages/testrun/{progress-routing.module.ts => testrun-routing.module.ts} (82%) rename modules/ui/src/app/pages/testrun/{progress.component.html => testrun.component.html} (93%) rename modules/ui/src/app/pages/testrun/{progress.component.scss => testrun.component.scss} (100%) rename modules/ui/src/app/pages/testrun/{progress.component.spec.ts => testrun.component.spec.ts} (95%) rename modules/ui/src/app/pages/testrun/{progress.component.ts => testrun.component.ts} (93%) rename modules/ui/src/app/pages/testrun/{progress.module.ts => testrun.module.ts} (77%) diff --git a/modules/ui/src/app/app-routing.module.ts b/modules/ui/src/app/app-routing.module.ts index 876074777..a9864fe63 100644 --- a/modules/ui/src/app/app-routing.module.ts +++ b/modules/ui/src/app/app-routing.module.ts @@ -20,7 +20,7 @@ const routes: Routes = [ { path: 'testing', loadChildren: () => - import('./pages/testrun/progress.module').then(m => m.ProgressModule), + import('./pages/testrun/testrun.module').then(m => m.TestrunModule), title: 'Testrun', }, { diff --git a/modules/ui/src/app/app.component.spec.ts b/modules/ui/src/app/app.component.spec.ts index 03a97b165..05042a7e0 100644 --- a/modules/ui/src/app/app.component.spec.ts +++ b/modules/ui/src/app/app.component.spec.ts @@ -38,7 +38,7 @@ import { CalloutComponent } from './components/callout/callout.component'; import { MOCK_PROGRESS_DATA_IDLE, MOCK_PROGRESS_DATA_IN_PROGRESS, -} from './mocks/progress.mock'; +} from './mocks/testrun.mock'; import { Routes } from './model/routes'; import { MockStore, provideMockStore } from '@ngrx/store/testing'; import { State } from '@ngrx/store'; diff --git a/modules/ui/src/app/app.store.spec.ts b/modules/ui/src/app/app.store.spec.ts index 585e05d28..db8412790 100644 --- a/modules/ui/src/app/app.store.spec.ts +++ b/modules/ui/src/app/app.store.spec.ts @@ -31,7 +31,7 @@ import { TestRunService } from './services/test-run.service'; import SpyObj = jasmine.SpyObj; import { device } from './mocks/device.mock'; import { fetchSystemStatus, setDevices } from './store/actions'; -import { MOCK_PROGRESS_DATA_IN_PROGRESS } from './mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_IN_PROGRESS } from './mocks/testrun.mock'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NotificationService } from './services/notification.service'; import { WINDOW } from './providers/window.provider'; diff --git a/modules/ui/src/app/components/download-report-pdf/download-report-pdf.component.spec.ts b/modules/ui/src/app/components/download-report-pdf/download-report-pdf.component.spec.ts index 914c130ac..01e5a09f8 100644 --- a/modules/ui/src/app/components/download-report-pdf/download-report-pdf.component.spec.ts +++ b/modules/ui/src/app/components/download-report-pdf/download-report-pdf.component.spec.ts @@ -16,7 +16,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DownloadReportPdfComponent } from './download-report-pdf.component'; -import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../mocks/testrun.mock'; describe('DownloadReportComponent', () => { let component: DownloadReportPdfComponent; diff --git a/modules/ui/src/app/components/download-report-zip/download-report-zip.component.spec.ts b/modules/ui/src/app/components/download-report-zip/download-report-zip.component.spec.ts index b9d492513..a02d62ca5 100644 --- a/modules/ui/src/app/components/download-report-zip/download-report-zip.component.spec.ts +++ b/modules/ui/src/app/components/download-report-zip/download-report-zip.component.spec.ts @@ -16,7 +16,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DownloadReportZipComponent } from './download-report-zip.component'; -import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../mocks/testrun.mock'; describe('DownloadReportComponent', () => { let component: DownloadReportZipComponent; diff --git a/modules/ui/src/app/components/download-report/download-report.component.spec.ts b/modules/ui/src/app/components/download-report/download-report.component.spec.ts index be4e86c82..f29430f54 100644 --- a/modules/ui/src/app/components/download-report/download-report.component.spec.ts +++ b/modules/ui/src/app/components/download-report/download-report.component.spec.ts @@ -20,7 +20,7 @@ import { MOCK_PROGRESS_DATA_CANCELLED, MOCK_PROGRESS_DATA_COMPLIANT, MOCK_PROGRESS_DATA_NON_COMPLIANT, -} from '../../mocks/progress.mock'; +} from '../../mocks/testrun.mock'; describe('DownloadReportComponent', () => { let component: DownloadReportComponent; diff --git a/modules/ui/src/app/components/report-action/report-action.component.spec.ts b/modules/ui/src/app/components/report-action/report-action.component.spec.ts index 2e5bedf84..b4d69b149 100644 --- a/modules/ui/src/app/components/report-action/report-action.component.spec.ts +++ b/modules/ui/src/app/components/report-action/report-action.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReportActionComponent } from './report-action.component'; -import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../mocks/testrun.mock'; describe('ReportActionComponent', () => { let component: ReportActionComponent; diff --git a/modules/ui/src/app/mocks/progress.mock.ts b/modules/ui/src/app/mocks/testrun.mock.ts similarity index 100% rename from modules/ui/src/app/mocks/progress.mock.ts rename to modules/ui/src/app/mocks/testrun.mock.ts diff --git a/modules/ui/src/app/pages/devices/devices.component.spec.ts b/modules/ui/src/app/pages/devices/devices.component.spec.ts index db156a6f2..26fcda197 100644 --- a/modules/ui/src/app/pages/devices/devices.component.spec.ts +++ b/modules/ui/src/app/pages/devices/devices.component.spec.ts @@ -36,7 +36,7 @@ import SpyObj = jasmine.SpyObj; import { FocusManagerService } from '../../services/focus-manager.service'; import { DevicesStore } from './devices.store'; import { MatIconTestingModule } from '@angular/material/icon/testing'; -import { ProgressInitiateFormComponent } from '../testrun/components/progress-initiate-form/progress-initiate-form.component'; +import { TestrunInitiateFormComponent } from '../testrun/components/testrun-initiate-form/testrun-initiate-form.component'; import { Routes } from '../../model/routes'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; @@ -300,12 +300,12 @@ describe('DevicesComponent', () => { it('should open initiate test run modal', fakeAsync(() => { const openSpy = spyOn(component.dialog, 'open').and.returnValue({ afterClosed: () => of(true), - } as MatDialogRef); + } as MatDialogRef); fixture.ngZone?.run(() => { component.openStartTestrun(device, [device]); - expect(openSpy).toHaveBeenCalledWith(ProgressInitiateFormComponent, { + expect(openSpy).toHaveBeenCalledWith(TestrunInitiateFormComponent, { ariaLabel: 'Initiate testrun', data: { devices: [device], diff --git a/modules/ui/src/app/pages/devices/devices.component.ts b/modules/ui/src/app/pages/devices/devices.component.ts index 2e8e8ebbc..d8c840a5f 100644 --- a/modules/ui/src/app/pages/devices/devices.component.ts +++ b/modules/ui/src/app/pages/devices/devices.component.ts @@ -34,7 +34,7 @@ import { FocusManagerService } from '../../services/focus-manager.service'; import { Routes } from '../../model/routes'; import { Router } from '@angular/router'; import { timer } from 'rxjs/internal/observable/timer'; -import { ProgressInitiateFormComponent } from '../testrun/components/progress-initiate-form/progress-initiate-form.component'; +import { TestrunInitiateFormComponent } from '../testrun/components/testrun-initiate-form/testrun-initiate-form.component'; import { DevicesStore } from './devices.store'; @Component({ @@ -76,7 +76,7 @@ export class DevicesComponent implements OnInit, OnDestroy { } openStartTestrun(selectedDevice: Device, devices: Device[]): void { - const dialogRef = this.dialog.open(ProgressInitiateFormComponent, { + const dialogRef = this.dialog.open(TestrunInitiateFormComponent, { ariaLabel: 'Initiate testrun', data: { devices, diff --git a/modules/ui/src/app/pages/reports/components/delete-report/delete-report.component.spec.ts b/modules/ui/src/app/pages/reports/components/delete-report/delete-report.component.spec.ts index 839d01c83..50537575a 100644 --- a/modules/ui/src/app/pages/reports/components/delete-report/delete-report.component.spec.ts +++ b/modules/ui/src/app/pages/reports/components/delete-report/delete-report.component.spec.ts @@ -19,7 +19,7 @@ import { DeleteReportComponent } from './delete-report.component'; import { of } from 'rxjs'; import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { DeleteFormComponent } from '../../../../components/delete-form/delete-form.component'; -import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../../../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_COMPLIANT } from '../../../../mocks/testrun.mock'; describe('DeleteReportComponent', () => { let compiled: HTMLElement; diff --git a/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.spec.ts b/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.spec.ts index 42d084a5c..5c4cca70b 100644 --- a/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.spec.ts +++ b/modules/ui/src/app/pages/testrun/components/download-options/download-options.component.spec.ts @@ -23,7 +23,7 @@ import { MOCK_PROGRESS_DATA_CANCELLED, MOCK_PROGRESS_DATA_COMPLIANT, MOCK_PROGRESS_DATA_NON_COMPLIANT, -} from '../../../../mocks/progress.mock'; +} from '../../../../mocks/testrun.mock'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { MatOptionSelectionChange } from '@angular/material/core'; diff --git a/modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.html b/modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.html similarity index 100% rename from modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.html rename to modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.html diff --git a/modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.scss b/modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.scss similarity index 100% rename from modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.scss rename to modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.scss diff --git a/modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.spec.ts b/modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.spec.ts similarity index 97% rename from modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.spec.ts rename to modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.spec.ts index 4f24ecaaa..9f456158f 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.spec.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.spec.ts @@ -15,7 +15,7 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProgressInitiateFormComponent } from './progress-initiate-form.component'; +import { TestrunInitiateFormComponent } from './testrun-initiate-form.component'; import { MAT_DIALOG_DATA, MatDialogModule, @@ -31,14 +31,14 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DeviceTestsComponent } from '../../../../components/device-tests/device-tests.component'; import { device } from '../../../../mocks/device.mock'; import { of } from 'rxjs'; -import { MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE } from '../../../../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE } from '../../../../mocks/testrun.mock'; import { SpinnerComponent } from '../../../../components/spinner/spinner.component'; import { provideMockStore } from '@ngrx/store/testing'; import { selectDevices } from '../../../../store/selectors'; describe('ProgressInitiateFormComponent', () => { - let component: ProgressInitiateFormComponent; - let fixture: ComponentFixture; + let component: TestrunInitiateFormComponent; + let fixture: ComponentFixture; let compiled: HTMLElement; const testRunServiceMock = jasmine.createSpyObj([ @@ -71,7 +71,7 @@ describe('ProgressInitiateFormComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ProgressInitiateFormComponent], + declarations: [TestrunInitiateFormComponent], providers: [ { provide: TestRunService, useValue: testRunServiceMock }, { @@ -96,7 +96,7 @@ describe('ProgressInitiateFormComponent', () => { SpinnerComponent, ], }); - fixture = TestBed.createComponent(ProgressInitiateFormComponent); + fixture = TestBed.createComponent(TestrunInitiateFormComponent); component = fixture.componentInstance; compiled = fixture.nativeElement as HTMLElement; }); diff --git a/modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.ts b/modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.ts similarity index 94% rename from modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.ts rename to modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.ts index 505df7271..0b9c3e09b 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-initiate-form/progress-initiate-form.component.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-initiate-form/testrun-initiate-form.component.ts @@ -44,11 +44,11 @@ interface DialogData { } @Component({ - selector: 'app-progress-initiate-form', - templateUrl: './progress-initiate-form.component.html', - styleUrls: ['./progress-initiate-form.component.scss'], + selector: 'app-testrun-initiate-form', + templateUrl: './testrun-initiate-form.component.html', + styleUrls: ['./testrun-initiate-form.component.scss'], }) -export class ProgressInitiateFormComponent +export class TestrunInitiateFormComponent extends EscapableDialogComponent implements OnInit, AfterViewChecked { @@ -65,7 +65,7 @@ export class ProgressInitiateFormComponent ); constructor( - public override dialogRef: MatDialogRef, + public override dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: DialogData, private readonly testRunService: TestRunService, private fb: FormBuilder, diff --git a/modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.html b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html similarity index 100% rename from modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.html rename to modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.html diff --git a/modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.scss b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.scss similarity index 100% rename from modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.scss rename to modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.scss diff --git a/modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.spec.ts b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.spec.ts similarity index 95% rename from modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.spec.ts rename to modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.spec.ts index 24b56a5c9..29fdd7731 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.spec.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.spec.ts @@ -15,7 +15,7 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProgressStatusCardComponent } from './progress-status-card.component'; +import { TestrunStatusCardComponent } from './testrun-status-card.component'; import { StatusOfTestrun, TestrunStatus, @@ -26,19 +26,19 @@ import { MOCK_PROGRESS_DATA_IN_PROGRESS, MOCK_PROGRESS_DATA_MONITORING, MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE, -} from '../../../../mocks/progress.mock'; -import { ProgressModule } from '../../progress.module'; +} from '../../../../mocks/testrun.mock'; +import { TestrunModule } from '../../testrun.module'; describe('ProgressStatusCardComponent', () => { - let component: ProgressStatusCardComponent; - let fixture: ComponentFixture; + let component: TestrunStatusCardComponent; + let fixture: ComponentFixture; describe('Class tests', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ProgressStatusCardComponent], + declarations: [TestrunStatusCardComponent], }); - fixture = TestBed.createComponent(ProgressStatusCardComponent); + fixture = TestBed.createComponent(TestrunStatusCardComponent); component = fixture.componentInstance; }); @@ -216,11 +216,11 @@ describe('ProgressStatusCardComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ProgressStatusCardComponent], - imports: [ProgressModule], + declarations: [TestrunStatusCardComponent], + imports: [TestrunModule], }).compileComponents(); - fixture = TestBed.createComponent(ProgressStatusCardComponent); + fixture = TestBed.createComponent(TestrunStatusCardComponent); compiled = fixture.nativeElement as HTMLElement; component = fixture.componentInstance; }); diff --git a/modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.ts b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts similarity index 94% rename from modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.ts rename to modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts index 804f5dcb4..027588b24 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-status-card/progress-status-card.component.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-status-card/testrun-status-card.component.ts @@ -22,12 +22,12 @@ import { } from '../../../../model/testrun-status'; @Component({ - selector: 'app-progress-status-card', - templateUrl: './progress-status-card.component.html', - styleUrls: ['./progress-status-card.component.scss'], + selector: 'app-testrun-status-card', + templateUrl: './testrun-status-card.component.html', + styleUrls: ['./testrun-status-card.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ProgressStatusCardComponent { +export class TestrunStatusCardComponent { @Input() systemStatus!: TestrunStatus; public readonly StatusOfTestrun = StatusOfTestrun; diff --git a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.html b/modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.html similarity index 100% rename from modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.html rename to modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.html diff --git a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.scss b/modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.scss similarity index 100% rename from modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.scss rename to modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.scss diff --git a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.spec.ts b/modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.spec.ts similarity index 90% rename from modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.spec.ts rename to modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.spec.ts index 317b8c103..60c325c3d 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.spec.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.spec.ts @@ -15,14 +15,14 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ProgressTableComponent } from './progress-table.component'; +import { TestrunTableComponent } from './testrun-table.component'; import { IResult, StatusOfTestResult } from '../../../../model/testrun-status'; import { TEST_DATA, TEST_DATA_RESULT, TEST_DATA_RESULT_WITH_RECOMMENDATIONS, -} from '../../../../mocks/progress.mock'; +} from '../../../../mocks/testrun.mock'; import { TestRunService } from '../../../../services/test-run.service'; import { MatExpansionModule } from '@angular/material/expansion'; import { Component, Input } from '@angular/core'; @@ -30,18 +30,18 @@ import { MatIconModule } from '@angular/material/icon'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('ProgressTableComponent', () => { - let component: ProgressTableComponent; - let fixture: ComponentFixture; + let component: TestrunTableComponent; + let fixture: ComponentFixture; const testRunServiceMock = jasmine.createSpyObj(['getResultClass']); describe('Class tests', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [ProgressTableComponent], + declarations: [TestrunTableComponent], providers: [{ provide: TestRunService, useValue: testRunServiceMock }], }); - fixture = TestBed.createComponent(ProgressTableComponent); + fixture = TestBed.createComponent(TestrunTableComponent); component = fixture.componentInstance; component.dataSource = TEST_DATA.results; }); @@ -80,12 +80,12 @@ describe('ProgressTableComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ProgressTableComponent, FakeCalloutComponent], + declarations: [TestrunTableComponent, FakeCalloutComponent], providers: [{ provide: TestRunService, useValue: testRunServiceMock }], imports: [BrowserAnimationsModule, MatExpansionModule, MatIconModule], }).compileComponents(); - fixture = TestBed.createComponent(ProgressTableComponent); + fixture = TestBed.createComponent(TestrunTableComponent); component = fixture.componentInstance; compiled = fixture.nativeElement as HTMLElement; }); diff --git a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts b/modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.ts similarity index 92% rename from modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts rename to modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.ts index 4b3d44939..40532dc29 100644 --- a/modules/ui/src/app/pages/testrun/components/progress-table/progress-table.component.ts +++ b/modules/ui/src/app/pages/testrun/components/testrun-table/testrun-table.component.ts @@ -30,12 +30,12 @@ import { CalloutType } from '../../../../model/callout-type'; import { TestRunService } from '../../../../services/test-run.service'; @Component({ - selector: 'app-progress-table', - templateUrl: './progress-table.component.html', - styleUrls: ['./progress-table.component.scss'], + selector: 'app-testrun-table', + templateUrl: './testrun-table.component.html', + styleUrls: ['./testrun-table.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) -export class ProgressTableComponent { +export class TestrunTableComponent { @ViewChild(MatAccordion) accordion!: MatAccordion; @ViewChildren(MatExpansionPanel) panels!: QueryList; public readonly CalloutType = CalloutType; diff --git a/modules/ui/src/app/pages/testrun/progress-routing.module.ts b/modules/ui/src/app/pages/testrun/testrun-routing.module.ts similarity index 82% rename from modules/ui/src/app/pages/testrun/progress-routing.module.ts rename to modules/ui/src/app/pages/testrun/testrun-routing.module.ts index 50556398e..903ce0bed 100644 --- a/modules/ui/src/app/pages/testrun/progress-routing.module.ts +++ b/modules/ui/src/app/pages/testrun/testrun-routing.module.ts @@ -15,12 +15,12 @@ */ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; -import { ProgressComponent } from './progress.component'; +import { TestrunComponent } from './testrun.component'; -const routes: Routes = [{ path: '', component: ProgressComponent }]; +const routes: Routes = [{ path: '', component: TestrunComponent }]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class ProgressRoutingModule {} +export class TestrunRoutingModule {} diff --git a/modules/ui/src/app/pages/testrun/progress.component.html b/modules/ui/src/app/pages/testrun/testrun.component.html similarity index 93% rename from modules/ui/src/app/pages/testrun/progress.component.html rename to modules/ui/src/app/pages/testrun/testrun.component.html index cec555993..9973edae7 100644 --- a/modules/ui/src/app/pages/testrun/progress.component.html +++ b/modules/ui/src/app/pages/testrun/testrun.component.html @@ -54,17 +54,17 @@

[data]="data"> - - + +
- + [stepsToResolveCount]="vm.stepsToResolveCount">
diff --git a/modules/ui/src/app/pages/testrun/progress.component.scss b/modules/ui/src/app/pages/testrun/testrun.component.scss similarity index 100% rename from modules/ui/src/app/pages/testrun/progress.component.scss rename to modules/ui/src/app/pages/testrun/testrun.component.scss diff --git a/modules/ui/src/app/pages/testrun/progress.component.spec.ts b/modules/ui/src/app/pages/testrun/testrun.component.spec.ts similarity index 95% rename from modules/ui/src/app/pages/testrun/progress.component.spec.ts rename to modules/ui/src/app/pages/testrun/testrun.component.spec.ts index f7ee51aa9..1e19e6726 100644 --- a/modules/ui/src/app/pages/testrun/progress.component.spec.ts +++ b/modules/ui/src/app/pages/testrun/testrun.component.spec.ts @@ -20,7 +20,7 @@ import { tick, } from '@angular/core/testing'; -import { ProgressComponent } from './progress.component'; +import { TestrunComponent } from './testrun.component'; import { TestRunService } from '../../services/test-run.service'; import { of } from 'rxjs'; import { @@ -31,14 +31,14 @@ import { MOCK_PROGRESS_DATA_MONITORING, MOCK_PROGRESS_DATA_NOT_STARTED, MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE, -} from '../../mocks/progress.mock'; +} from '../../mocks/testrun.mock'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatToolbarModule } from '@angular/material/toolbar'; import { Component, Input } from '@angular/core'; import { IResult, TestrunStatus } from '../../model/testrun-status'; import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; -import { ProgressInitiateFormComponent } from './components/progress-initiate-form/progress-initiate-form.component'; +import { TestrunInitiateFormComponent } from './components/testrun-initiate-form/testrun-initiate-form.component'; import { DeleteFormComponent } from '../../components/delete-form/delete-form.component'; import { SpinnerComponent } from '../../components/spinner/spinner.component'; import { LoaderService } from '../../services/loader.service'; @@ -59,8 +59,8 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NotificationService } from '../../services/notification.service'; describe('ProgressComponent', () => { - let component: ProgressComponent; - let fixture: ComponentFixture; + let component: TestrunComponent; + let fixture: ComponentFixture; let compiled: HTMLElement; let store: MockStore; @@ -96,7 +96,7 @@ describe('ProgressComponent', () => { testRunServiceMock.stopTestrun.and.returnValue(of(true)); TestBed.configureTestingModule({ declarations: [ - ProgressComponent, + TestrunComponent, FakeProgressStatusCardComponent, FakeProgressTableComponent, FakeDownloadOptionsComponent, @@ -133,7 +133,7 @@ describe('ProgressComponent', () => { BrowserAnimationsModule, ], }) - .overrideComponent(ProgressComponent, { + .overrideComponent(TestrunComponent, { set: { providers: [ { provide: LoaderService, useValue: loaderServiceMock }, @@ -146,7 +146,7 @@ describe('ProgressComponent', () => { of(MOCK_PROGRESS_DATA_IN_PROGRESS) ); store = TestBed.inject(MockStore); - fixture = TestBed.createComponent(ProgressComponent); + fixture = TestBed.createComponent(TestrunComponent); spyOn(store, 'dispatch').and.callFake(() => {}); component = fixture.componentInstance; }); @@ -217,7 +217,7 @@ describe('ProgressComponent', () => { await TestBed.configureTestingModule({ declarations: [ - ProgressComponent, + TestrunComponent, FakeProgressStatusCardComponent, FakeProgressTableComponent, FakeDownloadOptionsComponent, @@ -250,7 +250,7 @@ describe('ProgressComponent', () => { BrowserAnimationsModule, ], }) - .overrideComponent(ProgressComponent, { + .overrideComponent(TestrunComponent, { set: { providers: [ { provide: LoaderService, useValue: loaderServiceMock }, @@ -260,7 +260,7 @@ describe('ProgressComponent', () => { .compileComponents(); store = TestBed.inject(MockStore); - fixture = TestBed.createComponent(ProgressComponent); + fixture = TestBed.createComponent(TestrunComponent); compiled = fixture.nativeElement as HTMLElement; testRunServiceMock.fetchSystemStatus.and.returnValue( of(MOCK_PROGRESS_DATA_IN_PROGRESS) @@ -312,14 +312,14 @@ describe('ProgressComponent', () => { it('should open initiate test run modal when start button clicked', fakeAsync(() => { const openSpy = spyOn(component.dialog, 'open').and.returnValue({ afterClosed: () => of(true), - } as MatDialogRef); + } as MatDialogRef); const startBtn = compiled.querySelector( '.start-button' ) as HTMLButtonElement; startBtn.click(); expect(openSpy).toHaveBeenCalled(); - expect(openSpy).toHaveBeenCalledWith(ProgressInitiateFormComponent, { + expect(openSpy).toHaveBeenCalledWith(TestrunInitiateFormComponent, { ariaLabel: 'Initiate testrun', autoFocus: true, hasBackdrop: true, diff --git a/modules/ui/src/app/pages/testrun/progress.component.ts b/modules/ui/src/app/pages/testrun/testrun.component.ts similarity index 93% rename from modules/ui/src/app/pages/testrun/progress.component.ts rename to modules/ui/src/app/pages/testrun/testrun.component.ts index 540f850ce..4a679b0e1 100644 --- a/modules/ui/src/app/pages/testrun/progress.component.ts +++ b/modules/ui/src/app/pages/testrun/testrun.component.ts @@ -26,7 +26,7 @@ import { } from '../../model/testrun-status'; import { Subject, takeUntil, timer } from 'rxjs'; import { MatDialog } from '@angular/material/dialog'; -import { ProgressInitiateFormComponent } from './components/progress-initiate-form/progress-initiate-form.component'; +import { TestrunInitiateFormComponent } from './components/testrun-initiate-form/testrun-initiate-form.component'; import { DeleteFormComponent } from '../../components/delete-form/delete-form.component'; import { LoaderService } from '../../services/loader.service'; import { LOADER_TIMEOUT_CONFIG_TOKEN } from '../../services/loaderConfig'; @@ -37,8 +37,8 @@ import { NotificationService } from '../../services/notification.service'; @Component({ selector: 'app-progress', - templateUrl: './progress.component.html', - styleUrls: ['./progress.component.scss'], + templateUrl: './testrun.component.html', + styleUrls: ['./testrun.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, providers: [ LoaderService, @@ -46,7 +46,7 @@ import { NotificationService } from '../../services/notification.service'; TestrunStore, ], }) -export class ProgressComponent implements OnInit, OnDestroy { +export class TestrunComponent implements OnInit, OnDestroy { public readonly StatusOfTestrun = StatusOfTestrun; private destroy$: Subject = new Subject(); viewModel$ = this.testrunStore.viewModel$; @@ -136,7 +136,7 @@ export class ProgressComponent implements OnInit, OnDestroy { } openTestRunModal(): void { - const dialogRef = this.dialog.open(ProgressInitiateFormComponent, { + const dialogRef = this.dialog.open(TestrunInitiateFormComponent, { ariaLabel: 'Initiate testrun', autoFocus: true, hasBackdrop: true, diff --git a/modules/ui/src/app/pages/testrun/progress.module.ts b/modules/ui/src/app/pages/testrun/testrun.module.ts similarity index 77% rename from modules/ui/src/app/pages/testrun/progress.module.ts rename to modules/ui/src/app/pages/testrun/testrun.module.ts index f46bf6199..d940c34bc 100644 --- a/modules/ui/src/app/pages/testrun/progress.module.ts +++ b/modules/ui/src/app/pages/testrun/testrun.module.ts @@ -21,11 +21,11 @@ import { MatToolbarModule } from '@angular/material/toolbar'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatExpansionModule } from '@angular/material/expansion'; -import { ProgressRoutingModule } from './progress-routing.module'; -import { ProgressComponent } from './progress.component'; -import { ProgressStatusCardComponent } from './components/progress-status-card/progress-status-card.component'; -import { ProgressTableComponent } from './components/progress-table/progress-table.component'; -import { ProgressInitiateFormComponent } from './components/progress-initiate-form/progress-initiate-form.component'; +import { TestrunRoutingModule } from './testrun-routing.module'; +import { TestrunComponent } from './testrun.component'; +import { TestrunStatusCardComponent } from './components/testrun-status-card/testrun-status-card.component'; +import { TestrunTableComponent } from './components/testrun-table/testrun-table.component'; +import { TestrunInitiateFormComponent } from './components/testrun-initiate-form/testrun-initiate-form.component'; import { MatDialogModule } from '@angular/material/dialog'; import { DeviceItemComponent } from '../../components/device-item/device-item.component'; import { MatInputModule } from '@angular/material/input'; @@ -38,14 +38,14 @@ import { DownloadOptionsComponent } from './components/download-options/download @NgModule({ declarations: [ - ProgressComponent, - ProgressStatusCardComponent, - ProgressTableComponent, - ProgressInitiateFormComponent, + TestrunComponent, + TestrunStatusCardComponent, + TestrunTableComponent, + TestrunInitiateFormComponent, ], imports: [ CommonModule, - ProgressRoutingModule, + TestrunRoutingModule, MatButtonModule, MatIconModule, MatToolbarModule, @@ -62,4 +62,4 @@ import { DownloadOptionsComponent } from './components/download-options/download DownloadOptionsComponent, ], }) -export class ProgressModule {} +export class TestrunModule {} diff --git a/modules/ui/src/app/pages/testrun/testrun.store.spec.ts b/modules/ui/src/app/pages/testrun/testrun.store.spec.ts index fba157bdc..219fbfb2f 100644 --- a/modules/ui/src/app/pages/testrun/testrun.store.spec.ts +++ b/modules/ui/src/app/pages/testrun/testrun.store.spec.ts @@ -43,7 +43,7 @@ import { MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE, TEST_DATA_RESULT_WITH_RECOMMENDATIONS, TEST_DATA_TABLE_RESULT, -} from '../../mocks/progress.mock'; +} from '../../mocks/testrun.mock'; import { LoaderService } from '../../services/loader.service'; describe('TestrunStore', () => { diff --git a/modules/ui/src/app/services/test-run.service.spec.ts b/modules/ui/src/app/services/test-run.service.spec.ts index 3a8a8c1f8..f3caaca59 100644 --- a/modules/ui/src/app/services/test-run.service.spec.ts +++ b/modules/ui/src/app/services/test-run.service.spec.ts @@ -22,7 +22,7 @@ import { Device, TestModule } from '../model/device'; import { TestRunService, UNAVAILABLE_VERSION } from './test-run.service'; import { SystemConfig, SystemInterfaces } from '../model/setting'; -import { MOCK_PROGRESS_DATA_IN_PROGRESS } from '../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_IN_PROGRESS } from '../mocks/testrun.mock'; import { StatusOfTestResult, StatusOfTestrun, diff --git a/modules/ui/src/app/store/effects.spec.ts b/modules/ui/src/app/store/effects.spec.ts index 5aee2fd90..36bb16fdb 100644 --- a/modules/ui/src/app/store/effects.spec.ts +++ b/modules/ui/src/app/store/effects.spec.ts @@ -37,7 +37,7 @@ import { device } from '../mocks/device.mock'; import { MOCK_PROGRESS_DATA_IN_PROGRESS, MOCK_PROGRESS_DATA_WAITING_FOR_DEVICE, -} from '../mocks/progress.mock'; +} from '../mocks/testrun.mock'; import { fetchSystemStatus, setStatus, setTestrunStatus } from './actions'; import { NotificationService } from '../services/notification.service'; describe('Effects', () => { diff --git a/modules/ui/src/app/store/reducers.spec.ts b/modules/ui/src/app/store/reducers.spec.ts index 389725fab..184628e04 100644 --- a/modules/ui/src/app/store/reducers.spec.ts +++ b/modules/ui/src/app/store/reducers.spec.ts @@ -32,7 +32,7 @@ import { updateFocusNavigation, } from './actions'; import { device } from '../mocks/device.mock'; -import { MOCK_PROGRESS_DATA_CANCELLING } from '../mocks/progress.mock'; +import { MOCK_PROGRESS_DATA_CANCELLING } from '../mocks/testrun.mock'; describe('Reducer', () => { describe('unknown action', () => { From ef9a63da90a67c33341ea867eed05eaf17fd29a4 Mon Sep 17 00:00:00 2001 From: kurilova Date: Fri, 24 May 2024 13:24:06 +0000 Subject: [PATCH 2/2] Fix tests --- modules/ui/src/app/pages/testrun/testrun.component.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ui/src/app/pages/testrun/testrun.component.spec.ts b/modules/ui/src/app/pages/testrun/testrun.component.spec.ts index 1e19e6726..1d21439c9 100644 --- a/modules/ui/src/app/pages/testrun/testrun.component.spec.ts +++ b/modules/ui/src/app/pages/testrun/testrun.component.spec.ts @@ -58,7 +58,7 @@ import { setTestrunStatus } from '../../store/actions'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NotificationService } from '../../services/notification.service'; -describe('ProgressComponent', () => { +describe('TestrunComponent', () => { let component: TestrunComponent; let fixture: ComponentFixture; let compiled: HTMLElement; @@ -526,7 +526,7 @@ describe('ProgressComponent', () => { }); @Component({ - selector: 'app-progress-status-card', + selector: 'app-testrun-status-card', template: '
', }) class FakeProgressStatusCardComponent { @@ -534,7 +534,7 @@ class FakeProgressStatusCardComponent { } @Component({ - selector: 'app-progress-table', + selector: 'app-testrun-table', template: '
', }) class FakeProgressTableComponent {