Skip to content

Commit

Permalink
MTM-59855 Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
enio_sultan committed Sep 20, 2024
1 parent 7963e86 commit 7a6e478
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import {
TopLevelFormatterParams,
} from 'echarts/types/src/component/tooltip/TooltipModel';
import { TooltipFormatterCallback } from 'echarts/types/src/util/types';
import {
AlarmSeveritiesToTitlePipe,
AlarmSeverityToIconPipe,
AlarmSeverityToLabelPipe,
} from '@c8y/ngx-components/alarms';

describe('EchartsOptionsService', () => {
let service: EchartsOptionsService;
Expand Down Expand Up @@ -75,6 +80,9 @@ describe('EchartsOptionsService', () => {
{ provide: DatePipe, useValue: datePipe },
{ provide: ChartTypesService, useValue: chartTypesService },
{ provide: YAxisService, useValue: yAxisService },
AlarmSeverityToIconPipe,
AlarmSeverityToLabelPipe,
AlarmSeveritiesToTitlePipe,
],
});
service = TestBed.inject(EchartsOptionsService);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TestBed } from '@angular/core/testing';
import { ChartAlarmsService } from './chart-alarms.service';
import { AlarmService, IAlarm, IFetchResponse } from '@c8y/client';
import { AlarmDetails } from '../alarm-event-selector';
import { AlarmDetails } from '@c8y/ngx-components/alarm-event-selector';

describe('ChartAlarmsService', () => {
let service: ChartAlarmsService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
DatapointsGraphWidgetConfig,
} from '../model';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { SimpleChanges } from '@angular/core';
import { Component, Input, SimpleChanges } from '@angular/core';
import { FetchClient, Realtime } from '@c8y/client';
import { PopoverModule } from 'ngx-bootstrap/popover';
import {
Expand All @@ -30,6 +30,16 @@ import {
AlarmsModule,
} from '@c8y/ngx-components/alarms';

@Component({
selector: 'c8y-alarms-filter',
template: ``,
})
// eslint-disable-next-line @angular-eslint/component-class-suffix
export class AlarmsFilterComponentMock {
@Input()
contextSourceId: number | string | null = null;
}

describe('DatapointsGraphWidgetViewComponent', () => {
let component: DatapointsGraphWidgetViewComponent;
let fixture: ComponentFixture<DatapointsGraphWidgetViewComponent>;
Expand Down Expand Up @@ -63,7 +73,10 @@ describe('DatapointsGraphWidgetViewComponent', () => {
PopoverModule,
AlarmsModule,
],
declarations: [DatapointsGraphWidgetViewComponent],
declarations: [
DatapointsGraphWidgetViewComponent,
AlarmsFilterComponentMock,
],
providers: [
{ provide: window, useValue: { ResizeObserver: {} } },
{ provide: FetchClient, useValue: client },
Expand Down

0 comments on commit 7a6e478

Please sign in to comment.