+import { HttpClientTestingModule } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
import { ToastrModule } from 'ngx-toastr';
-import { HttpClientTestingModule } from '@angular/common/http/testing';
-import {
- configureTestBed,
- i18nProviders,
- PrometheusHelper
-} from '../../../testing/unit-test-helper';
+import { configureTestBed, PrometheusHelper } from '~/testing/unit-test-helper';
import { NotificationType } from '../enum/notification-type.enum';
import { CdNotificationConfig } from '../models/cd-notification';
import { PrometheusCustomAlert } from '../models/prometheus-alerts';
configureTestBed({
imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
- providers: [PrometheusAlertFormatter, i18nProviders]
+ providers: [PrometheusAlertFormatter]
});
beforeEach(() => {
prometheus = new PrometheusHelper();
- service = TestBed.get(PrometheusAlertFormatter);
- notificationService = TestBed.get(NotificationService);
+ service = TestBed.inject(PrometheusAlertFormatter);
+ notificationService = TestBed.inject(NotificationService);
spyOn(notificationService, 'show').and.stub();
});
{
status: 'active',
name: 'Something',
- summary: 'Something is active',
+ description: 'Something is active',
url: 'http://Something',
fingerprint: 'Something'
} as PrometheusCustomAlert
fingerprint: false,
status: 'active',
name: 'Something',
- summary: 'Something is firing',
+ description: 'Something is firing',
url: 'http://Something'
} as PrometheusCustomAlert
]);
const alert: PrometheusCustomAlert = {
status: 'active',
name: 'Some alert',
- summary: 'Some alert is active',
+ description: 'Some alert is active',
url: 'http://some-alert',
fingerprint: '42'
};