diff --git a/cmd/ui/app/common/components/artifact_card/artifact_card.ng.html b/cmd/ui/app/common/components/artifact_card/artifact_card.ng.html index d6a76b4e8..17f00325f 100644 --- a/cmd/ui/app/common/components/artifact_card/artifact_card.ng.html +++ b/cmd/ui/app/common/components/artifact_card/artifact_card.ng.html @@ -24,9 +24,9 @@
@if (displayProperties().url) { {{ displayProperties().icon }} @@ -183,12 +183,7 @@
diff --git a/cmd/ui/app/common/components/artifact_card/artifact_card.scss b/cmd/ui/app/common/components/artifact_card/artifact_card.scss index e4464e216..bd66150ef 100644 --- a/cmd/ui/app/common/components/artifact_card/artifact_card.scss +++ b/cmd/ui/app/common/components/artifact_card/artifact_card.scss @@ -26,6 +26,11 @@ cursor: pointer; } + .artifact-icon-link { + text-decoration: none; + color: inherit; + } + .card-main-content { display: flex; align-items: center; diff --git a/cmd/ui/app/common/components/dashboard/dashboard_grid/dashboard_grid_test.ts b/cmd/ui/app/common/components/dashboard/dashboard_grid/dashboard_grid_test.ts index 6c33bea3b..028a3c953 100644 --- a/cmd/ui/app/common/components/dashboard/dashboard_grid/dashboard_grid_test.ts +++ b/cmd/ui/app/common/components/dashboard/dashboard_grid/dashboard_grid_test.ts @@ -82,7 +82,6 @@ class TestHostComponent { describe('DashboardGridComponent', () => { let fixture: ComponentFixture; - let host: TestHostComponent; let harness: DashboardGridHarness; let dashboardServiceSpy: jasmine.SpyObj; @@ -100,7 +99,6 @@ describe('DashboardGridComponent', () => { }).compileComponents(); fixture = TestBed.createComponent(TestHostComponent); - host = fixture.componentInstance; fixture.detectChanges(); const loader = TestbedHarnessEnvironment.loader(fixture); harness = await loader.getHarness(DashboardGridHarness); diff --git a/cmd/ui/app/common/components/resource_chip/resource_chip.ng.html b/cmd/ui/app/common/components/resource_chip/resource_chip.ng.html index ab9d26f57..2b8143c1b 100644 --- a/cmd/ui/app/common/components/resource_chip/resource_chip.ng.html +++ b/cmd/ui/app/common/components/resource_chip/resource_chip.ng.html @@ -13,13 +13,6 @@ See the License for the specific language governing permissions and limitations under the License. --> - + {{ text() }} diff --git a/cmd/ui/app/common/components/resource_chip/resource_chip.ts b/cmd/ui/app/common/components/resource_chip/resource_chip.ts index 81bae50f4..2d0791bc0 100644 --- a/cmd/ui/app/common/components/resource_chip/resource_chip.ts +++ b/cmd/ui/app/common/components/resource_chip/resource_chip.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { ChangeDetectionStrategy, Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core'; import { MatChipsModule } from '@angular/material/chips'; /** The resource type */ @@ -23,6 +23,14 @@ export enum ResourceType { UNKNOWN = 'UNKNOWN', } +const RESOURCE_COLOR_MAP: Readonly> = { + [ResourceType.CPU]: 'grey', + [ResourceType.MEMORY]: 'grey', + [ResourceType.UNKNOWN]: 'grey', + [ResourceType.GPU]: 'green', + [ResourceType.TPU]: 'green', +}; + /** The resource chip component. */ @Component({ selector: 'xmc-resource-chip', @@ -36,5 +44,5 @@ export class ResourceChip { readonly resourceType = input.required(); readonly text = input.required(); - readonly ResourceType = ResourceType; + protected readonly chipColor = computed(() => RESOURCE_COLOR_MAP[this.resourceType()]); } diff --git a/cmd/ui/app/common/components/resource_chip/resource_chip_test.ts b/cmd/ui/app/common/components/resource_chip/resource_chip_test.ts index 556b340c4..b9719a30e 100644 --- a/cmd/ui/app/common/components/resource_chip/resource_chip_test.ts +++ b/cmd/ui/app/common/components/resource_chip/resource_chip_test.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { getHarness } from '@angular/cdk/testing/catalyst/async'; +import { TestBed } from '@angular/core/testing'; import { MatChipHarness } from '@angular/material/chips/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; @@ -37,7 +38,9 @@ describe('ResourceChip Component', () => { const testCases = [ { name: 'CPU', type: ResourceType.CPU, expectedClass: 'grey' }, { name: 'MEMORY', type: ResourceType.MEMORY, expectedClass: 'grey' }, + { name: 'UNKNOWN', type: ResourceType.UNKNOWN, expectedClass: 'grey' }, { name: 'GPU', type: ResourceType.GPU, expectedClass: 'green' }, + { name: 'TPU', type: ResourceType.TPU, expectedClass: 'green' }, ]; for (const tc of testCases) { @@ -47,9 +50,30 @@ describe('ResourceChip Component', () => { const chipHarness = await getHarness(MatChipHarness); const host = await chipHarness.host(); + expect(await host.hasClass('mat-mdc-chip')) + .withContext('Expected host Material chip class to be preserved') + .toBeTrue(); expect(await host.hasClass(tc.expectedClass)) .withContext(`Expected to have class "${tc.expectedClass}"`) .toBeTrue(); }); } + + it('updates chip class cleanly when resourceType changes without dropping host classes', () => { + const fixture = TestBed.createComponent(ResourceChip); + fixture.componentRef.setInput('resourceType', ResourceType.CPU); + fixture.componentRef.setInput('text', 'CPU'); + fixture.detectChanges(); + + const chipEl = fixture.nativeElement.querySelector('mat-chip') as HTMLElement; + expect(chipEl.classList.contains('mat-mdc-chip')).toBeTrue(); + expect(chipEl.classList.contains('grey')).toBeTrue(); + + fixture.componentRef.setInput('resourceType', ResourceType.GPU); + fixture.detectChanges(); + + expect(chipEl.classList.contains('mat-mdc-chip')).toBeTrue(); + expect(chipEl.classList.contains('grey')).toBeFalse(); + expect(chipEl.classList.contains('green')).toBeTrue(); + }); }); diff --git a/cmd/ui/app/common/components/status_chip/status_chip.ng.html b/cmd/ui/app/common/components/status_chip/status_chip.ng.html index 6df4626ef..afb72178a 100644 --- a/cmd/ui/app/common/components/status_chip/status_chip.ng.html +++ b/cmd/ui/app/common/components/status_chip/status_chip.ng.html @@ -13,20 +13,4 @@ See the License for the specific language governing permissions and limitations under the License. --> - - {{ replicas() }} {{ status() }} - +{{ replicas() }} {{ status() }} diff --git a/cmd/ui/app/common/components/status_chip/status_chip.ts b/cmd/ui/app/common/components/status_chip/status_chip.ts index 8d087267f..53ce6155e 100644 --- a/cmd/ui/app/common/components/status_chip/status_chip.ts +++ b/cmd/ui/app/common/components/status_chip/status_chip.ts @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -import { ChangeDetectionStrategy, Component, input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core'; import { MatChipsModule } from '@angular/material/chips'; /** @@ -35,6 +35,25 @@ export enum StatusOption { UNKNOWN = 'Unknown', } +const STATUS_COLOR_MAP: Readonly> = { + [StatusOption.SUCCESS]: 'green', + [StatusOption.COMPLETED]: 'green', + // TODO: Add .light-green and .grey CSS rules in status_chip.scss so STARTING/DESCHEDULING/SCHEDULING chips render distinct colors. + [StatusOption.STARTING]: 'light-green', + [StatusOption.FAILED]: 'red', + [StatusOption.RUNNING]: 'blue', + [StatusOption.NOT_RUNNING]: 'blue', + [StatusOption.PENDING]: 'yellow', + [StatusOption.INITIALIZING]: 'yellow', + [StatusOption.UNKNOWN]: 'yellow', + [StatusOption.RESTARTING]: 'yellow', + [StatusOption.DESCHEDULING]: 'grey', + [StatusOption.SCHEDULING]: 'grey', + [StatusOption.SCHEDULING_PAUSED]: 'orange', + [StatusOption.STOPPING]: 'black', + [StatusOption.STOPPED]: 'black', +}; + /** * Display a status chip for an experiment, work unit, or job. */ @@ -53,5 +72,5 @@ export class StatusChip { // jobs in a work unit. readonly replicas = input(undefined); - readonly StatusOption = StatusOption; + protected readonly statusColor = computed(() => STATUS_COLOR_MAP[this.status()]); } diff --git a/cmd/ui/app/common/components/status_chip/status_chip_test.ts b/cmd/ui/app/common/components/status_chip/status_chip_test.ts new file mode 100644 index 000000000..76abda0c4 --- /dev/null +++ b/cmd/ui/app/common/components/status_chip/status_chip_test.ts @@ -0,0 +1,87 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import { getHarness } from '@angular/cdk/testing/catalyst/async'; +import { TestBed } from '@angular/core/testing'; +import { MatChipHarness } from '@angular/material/chips/testing'; +import { NoopAnimationsModule } from '@angular/platform-browser/animations'; + +import { bootstrap, setupModule } from 'app/testing/test'; + +import { StatusChip, StatusOption } from './status_chip'; + +describe('StatusChip Component', () => { + beforeEach(() => { + setupModule({ + imports: [StatusChip, NoopAnimationsModule], + }); + }); + + it('displays status with optional replica count', async () => { + bootstrap(StatusChip, { status: StatusOption.RUNNING, replicas: 4 }); + + const chipHarness = await getHarness(MatChipHarness); + expect(await chipHarness.getText()).toBe('4 Running'); + }); + + const expectedColors: ReadonlyArray<{ status: StatusOption; expectedClass: string }> = [ + { status: StatusOption.SUCCESS, expectedClass: 'green' }, + { status: StatusOption.COMPLETED, expectedClass: 'green' }, + { status: StatusOption.STARTING, expectedClass: 'light-green' }, + { status: StatusOption.FAILED, expectedClass: 'red' }, + { status: StatusOption.RUNNING, expectedClass: 'blue' }, + { status: StatusOption.NOT_RUNNING, expectedClass: 'blue' }, + { status: StatusOption.PENDING, expectedClass: 'yellow' }, + { status: StatusOption.INITIALIZING, expectedClass: 'yellow' }, + { status: StatusOption.UNKNOWN, expectedClass: 'yellow' }, + { status: StatusOption.RESTARTING, expectedClass: 'yellow' }, + { status: StatusOption.DESCHEDULING, expectedClass: 'grey' }, + { status: StatusOption.SCHEDULING, expectedClass: 'grey' }, + { status: StatusOption.SCHEDULING_PAUSED, expectedClass: 'orange' }, + { status: StatusOption.STOPPING, expectedClass: 'black' }, + { status: StatusOption.STOPPED, expectedClass: 'black' }, + ]; + + for (const tc of expectedColors) { + it(`applies ${tc.expectedClass} class and keeps mat-mdc-chip for ${tc.status}`, async () => { + bootstrap(StatusChip, { status: tc.status }); + + const chipHarness = await getHarness(MatChipHarness); + const host = await chipHarness.host(); + + expect(await host.hasClass('mat-mdc-chip')) + .withContext('Expected host Material chip class to be preserved') + .toBeTrue(); + expect(await host.hasClass(tc.expectedClass)) + .withContext(`Expected status "${tc.status}" to apply class "${tc.expectedClass}"`) + .toBeTrue(); + }); + } + + it('updates chip color class dynamically when status changes without dropping host classes', () => { + const fixture = TestBed.createComponent(StatusChip); + fixture.componentRef.setInput('status', StatusOption.RUNNING); + fixture.detectChanges(); + + const chipEl = fixture.nativeElement.querySelector('mat-chip') as HTMLElement; + expect(chipEl.classList.contains('mat-mdc-chip')).toBeTrue(); + expect(chipEl.classList.contains('blue')).toBeTrue(); + + fixture.componentRef.setInput('status', StatusOption.COMPLETED); + fixture.detectChanges(); + + expect(chipEl.classList.contains('mat-mdc-chip')).toBeTrue(); + expect(chipEl.classList.contains('blue')).toBeFalse(); + expect(chipEl.classList.contains('green')).toBeTrue(); + }); +}); diff --git a/cmd/ui/app/common/components/status_message/status_message.ng.html b/cmd/ui/app/common/components/status_message/status_message.ng.html index d0e2180be..93128942b 100644 --- a/cmd/ui/app/common/components/status_message/status_message.ng.html +++ b/cmd/ui/app/common/components/status_message/status_message.ng.html @@ -14,9 +14,9 @@ limitations under the License. --> @if (isVisible$ | async) { -
-
-
+
+
+
{{ message().userFacingText }}
@if (message().auxiliaryInfo?.queueInfo; as queueInfo) {
diff --git a/cmd/ui/app/common/components/status_message/status_message.ts b/cmd/ui/app/common/components/status_message/status_message.ts index 9407aec65..1313ce744 100644 --- a/cmd/ui/app/common/components/status_message/status_message.ts +++ b/cmd/ui/app/common/components/status_message/status_message.ts @@ -103,6 +103,12 @@ export class StatusMessage { return 'blue-vertical-line'; }); + protected readonly severityPrefix = computed( + () => this.message().severity?.toLowerCase() || 'info', + ); + protected readonly containerClass = computed(() => `${this.severityPrefix()}-message-container`); + protected readonly messageClass = computed(() => `${this.severityPrefix()}-message`); + protected readonly urlsForWidget = computed(() => { const url = this.message().userFacingUrl; if (!url?.url) { diff --git a/cmd/ui/app/common/components/work_units_status_bar/work_units_status_bar.ng.html b/cmd/ui/app/common/components/work_units_status_bar/work_units_status_bar.ng.html index 7bfe2e8e4..b7735f39a 100644 --- a/cmd/ui/app/common/components/work_units_status_bar/work_units_status_bar.ng.html +++ b/cmd/ui/app/common/components/work_units_status_bar/work_units_status_bar.ng.html @@ -25,7 +25,10 @@
@for (stateCount of sortedStateCounts(); track stateCount.state) { @if (stateCount.count && stateCount.count !== '0') { - + {{ stateCount.count }} } @@ -39,7 +42,7 @@ @if (stateCount.count && stateCount.count !== '0' && stateCount.state) {
-
+
{{ stateCount.state.toLowerCase() }}:
{{ stateCount.count }}
diff --git a/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ng.html b/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ng.html index 2a8d6d888..b47062e2f 100644 --- a/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ng.html +++ b/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ng.html @@ -73,9 +73,7 @@ type="button" mat-icon-button class="remove-resource-btn" - [attr.aria-label]=" - 'Remove ' + (row.resourceType || 'resource filter') + ' (row ' + ($index + 1) + ')' - " + [attr.aria-label]="removeRowAriaLabels()[$index]" (click)="removeRow($index)" > close diff --git a/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ts b/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ts index db83635e9..5e9f3975a 100644 --- a/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ts +++ b/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder.ts @@ -12,7 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { ChangeDetectionStrategy, Component, input, OnInit, output, signal } from '@angular/core'; +import { + ChangeDetectionStrategy, + Component, + computed, + input, + OnInit, + output, + signal, +} from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatOptionModule } from '@angular/material/core'; @@ -57,6 +65,11 @@ export class SmartResourceFinderComponent implements OnInit { protected readonly dominantTooltip = ROD_TERM_TOOLTIPS.dominantResource; protected readonly rows = signal([createRow(1, '')]); + protected readonly removeRowAriaLabels = computed(() => + this.rows().map( + (row, index) => `Remove ${row.resourceType || 'resource filter'} (row ${index + 1})`, + ), + ); ngOnInit() { this.emitQuery(); diff --git a/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder_test.ts b/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder_test.ts index bcaf2662a..68064c2bb 100644 --- a/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder_test.ts +++ b/cmd/ui/app/resource_dashboard/components/smart_resource_finder/smart_resource_finder_test.ts @@ -177,4 +177,17 @@ describe('SmartResourceFinderComponent', () => { 'The primary resource used to calculate and display queue velocity and pending demand metrics on queue cards.', ); }); + + it('should compute remove button aria-labels from row resource types', async () => { + await harness.clickAddButton(); + await harness.selectResourceType(0, 'nvidia.com/gpu'); + fixture.detectChanges(); + + const buttons = fixture.nativeElement.querySelectorAll( + '.remove-resource-btn', + ) as NodeListOf; + expect(buttons.length).toBe(2); + expect(buttons[0].getAttribute('aria-label')).toBe('Remove nvidia.com/gpu (row 1)'); + expect(buttons[1].getAttribute('aria-label')).toBe('Remove resource filter (row 2)'); + }); }); diff --git a/cmd/ui/app/service/auth.service_test.ts b/cmd/ui/app/service/auth.service_test.ts index 368001ad9..a70e929ac 100644 --- a/cmd/ui/app/service/auth.service_test.ts +++ b/cmd/ui/app/service/auth.service_test.ts @@ -13,7 +13,6 @@ // limitations under the License. import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; -import { TestBed } from '@angular/core/testing'; import { cleanState, get, setupModule } from '../testing/test'; import { AuthService, UserResponse } from './auth.service'; diff --git a/cmd/ui/app/service/resource_service_test.ts b/cmd/ui/app/service/resource_service_test.ts index 22a4e37d0..ba18e80be 100644 --- a/cmd/ui/app/service/resource_service_test.ts +++ b/cmd/ui/app/service/resource_service_test.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { HttpClient, HttpRequest, provideHttpClient } from '@angular/common/http'; +import { HttpRequest, provideHttpClient } from '@angular/common/http'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { firstValueFrom } from 'rxjs'; diff --git a/cmd/ui/app/service/testing/mock_status_message_service.ts b/cmd/ui/app/service/testing/mock_status_message_service.ts index 21a87a096..2f98ce12d 100644 --- a/cmd/ui/app/service/testing/mock_status_message_service.ts +++ b/cmd/ui/app/service/testing/mock_status_message_service.ts @@ -28,7 +28,7 @@ import { StatusMessageService } from '../status_message_service'; @Injectable({ providedIn: 'root' }) export class MockStatusMessageService extends StatusMessageService { override listStatusMessages( - request: ListStatusMessagesRequest, + _request: ListStatusMessagesRequest, ): Observable { return of({ statusMessages: MOCK_HISTORICAL_STATUS_MESSAGES, diff --git a/cmd/ui/app/service/testing/mock_work_units_service.ts b/cmd/ui/app/service/testing/mock_work_units_service.ts index 4c6f14e62..1219711d7 100644 --- a/cmd/ui/app/service/testing/mock_work_units_service.ts +++ b/cmd/ui/app/service/testing/mock_work_units_service.ts @@ -33,7 +33,7 @@ import { WorkUnitsService } from '../work_units_service'; @Injectable({ providedIn: 'root' }) export class MockWorkUnitsService extends WorkUnitsService { override searchWorkUnits( - request: api.ListWorkUnitsRequest, + _request: api.ListWorkUnitsRequest, ): Observable { return of({ workUnits: WORK_UNIT_LIST, @@ -60,11 +60,11 @@ export class MockWorkUnitsService extends WorkUnitsService { return of({ name: `${name.xid}/${name.wid}`, done: true }); } - override batchStopWorkUnits(xid: string): Observable { + override batchStopWorkUnits(_xid: string): Observable { return of({ done: true }); } - override batchRestartWorkUnits(xid: string): Observable { + override batchRestartWorkUnits(_xid: string): Observable { return of({ done: true }); } } diff --git a/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_pipes_test.ts b/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_pipes_test.ts index 62c8083db..0edfe78fc 100644 --- a/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_pipes_test.ts +++ b/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_pipes_test.ts @@ -13,7 +13,6 @@ // limitations under the License. import { ResourceType } from 'app/common/components/resource_chip/resource_chip'; -import { ResourceChipData } from 'app/common/components/resource_chip/resource_set_to_resource_chips'; import { StatusOption } from 'app/common/components/status_chip/status_chip'; import { DashboardJob, Resource } from 'app/protos/rod'; diff --git a/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_table_test.ts b/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_table_test.ts index 6fe299de9..f5d809e2c 100644 --- a/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_table_test.ts +++ b/cmd/ui/app/side_panel/contents/queue_jobs_table/queue_jobs_table_test.ts @@ -13,7 +13,7 @@ // limitations under the License. import { getHarness } from '@angular/cdk/testing/catalyst/async'; -import { Component, computed, signal } from '@angular/core'; +import { Component, signal } from '@angular/core'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { provideRouter } from '@angular/router'; import { of, Subject, throwError } from 'rxjs'; @@ -22,7 +22,7 @@ import { GetRunningAndPendingJobsResponse } from 'app/protos/rod'; import { ResourceService } from 'app/service/resource_service'; import { bootstrap, cleanState, flush, setupModule } from 'app/testing/test'; -import { QueueJobsTable, QueueJobsTableData } from './queue_jobs_table'; +import { QueueJobsTable } from './queue_jobs_table'; import { QueueJobsTableHarness } from './queue_jobs_table_harness'; const EMPTY_STATE_SELECTOR = '.jobs-empty-state'; diff --git a/cmd/ui/app/testing/test.ts b/cmd/ui/app/testing/test.ts index 504fdb4b1..d0754bd48 100644 --- a/cmd/ui/app/testing/test.ts +++ b/cmd/ui/app/testing/test.ts @@ -62,7 +62,7 @@ export function bootstrap(component: any, options?: any): any { for (const key of Object.keys(options)) { try { fixture.componentRef.setInput(key, options[key]); - } catch (e) { + } catch (_e) { (fixture.componentInstance as any)[key] = options[key]; } } @@ -74,7 +74,7 @@ export function bootstrap(component: any, options?: any): any { if (cmpDef && cmpDef.selectors && cmpDef.selectors[0]) { selector = cmpDef.selectors[0][0]; } - } catch (e) { + } catch (_e) { // Fallback or ignore } if (selector) { @@ -104,7 +104,7 @@ export async function getHarness(query: any): Promise { if (isRootMatch) { try { return await TestbedHarnessEnvironment.harnessForFixture(currentFixture, query); - } catch (e) { + } catch (_e) { // Fallback to loader if harnessForFixture fails } } @@ -281,7 +281,7 @@ export function setupObservableMatchers() { }, }; }, - toHaveNeverEmitted(util: any, customEqualityTesters: any): any { + toHaveNeverEmitted(_util: any, _customEqualityTesters: any): any { return { compare(actual: any): any { return new Promise(async (resolve) => { diff --git a/cmd/ui/app/testing/testing.d.ts b/cmd/ui/app/testing/testing.d.ts index 9e1741773..36b8f4ee7 100644 --- a/cmd/ui/app/testing/testing.d.ts +++ b/cmd/ui/app/testing/testing.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { TestModuleMetadata } from '@angular/core/testing'; +export {}; declare global { const require: { diff --git a/cmd/ui/app/work_unit_page/work_unit_page_test.ts b/cmd/ui/app/work_unit_page/work_unit_page_test.ts index 323a62db3..945f226d5 100644 --- a/cmd/ui/app/work_unit_page/work_unit_page_test.ts +++ b/cmd/ui/app/work_unit_page/work_unit_page_test.ts @@ -27,7 +27,7 @@ import { bootstrap, cleanState, setupModule } from '../testing/test'; import { WorkUnitPage } from './work_unit_page'; describe('WorkUnitPage Component', () => { - const state = cleanState(() => { + cleanState(() => { const workUnitsService = jasmine.createSpyObj('WorkUnitsService', [ 'getWorkUnit', 'searchWorkUnits',