Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
*/
export function initializeApp(appConfig: AppConfig): () => Promise {
return () => appConfig.load();
}
/**
* Base module, bootstrapped in the main file.
*/
@NgModule({
declarations: [AppComponent, NavBarComponent, SideMenuComponent],
imports: [
BrowserModule,
HttpClientModule,
NgxUiLoaderModule, // "loader" (spinner) component
BrowserAnimationsModule, // required by toastr
ToastrModule.forRoot({ preventDuplicates: true, autoDismiss: true, enableHtml: true }),
CookieModule.forRoot(),
NgbModule,
SharedModule,
GmsCoreModule.forRoot(),
HomeModule,
AppRoutingModule
],
providers: [
AppConfig,
{
provide: APP_INITIALIZER,
useFactory: initializeApp,
deps: [AppConfig],
multi: true
}
],
MenuAsideComponent,
ControlSidebarComponent,
MessagesBoxComponent,
NotificationBoxComponent,
TasksBoxComponent,
UserBoxComponent,
ComponentLoaderComponent,
// LAYOUTS
LayoutAuthComponent,
LayoutLoginComponent,
LayoutRegisterComponent
],
imports: [
BrowserModule,
RouterModule,
ToastrModule.forRoot({
timeOut: 10000,
positionClass: 'toast-top-right',
preventDuplicates: true,
tapToDismiss: false,
newestOnTop: true
}),
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}),
],
exports: [
return '';
}
return require(`raw-loader!../translate/messages.${locale}.xlf`);
}
@NgModule({
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
BrowserAnimationsModule,
appRoutes,
ClipboardModule,
JwBootstrapSwitchNg2Module,
TooltipModule.forRoot(),
ToastrModule.forRoot(),
ModalModule.forRoot(),
CollapseModule.forRoot(),
PopoverModule.forRoot(),
BsDropdownModule.forRoot(),
SlimLoadingBarModule.forRoot(),
BsDatepickerModule.forRoot(),
YagaModule
],
declarations: [AppComponent,
LoginComponent,
ShareLoginComponent,
GalleryComponent,
FacesComponent,
// misc
FrameComponent,
LanguageComponent,
describe('OsdPgScrubModalComponent', () => {
let component: OsdPgScrubModalComponent;
let fixture: ComponentFixture;
let configurationService: ConfigurationService;
configureTestBed({
imports: [
HttpClientTestingModule,
ModalModule.forRoot(),
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
ToastrModule.forRoot()
],
declarations: [OsdPgScrubModalComponent],
providers: [BsModalRef, i18nProviders]
});
beforeEach(() => {
fixture = TestBed.createComponent(OsdPgScrubModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
configurationService = TestBed.get(ConfigurationService);
});
it('should create', () => {
expect(component).toBeTruthy();
});
describe('PrometheusAlertService', () => {
let service: PrometheusAlertService;
let notificationService: NotificationService;
let alerts: AlertmanagerAlert[];
let prometheusService: PrometheusService;
let prometheus: PrometheusHelper;
configureTestBed({
imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
providers: [PrometheusAlertService, PrometheusAlertFormatter, i18nProviders]
});
beforeEach(() => {
prometheus = new PrometheusHelper();
});
it('should create', () => {
expect(TestBed.get(PrometheusAlertService)).toBeTruthy();
});
describe('test error cases', () => {
const expectDisabling = (status, expectation) => {
let disabledSetting = false;
const resp = { status: status, error: {} };
service = new PrometheusAlertService(null, ({
let hostListSpy;
const fakeAuthStorageService = {
getPermissions: () => {
return new Permissions({ hosts: ['read', 'update', 'create', 'delete'] });
}
};
configureTestBed({
imports: [
SharedModule,
HttpClientTestingModule,
TabsModule.forRoot(),
BsDropdownModule.forRoot(),
RouterTestingModule,
ToastrModule.forRoot()
],
providers: [{ provide: AuthStorageService, useValue: fakeAuthStorageService }, i18nProviders],
declarations: [HostsComponent, HostDetailsComponent, InventoryComponent, ServicesComponent]
});
beforeEach(() => {
fixture = TestBed.createComponent(HostsComponent);
component = fixture.componentInstance;
hostListSpy = spyOn(TestBed.get(HostService), 'list');
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
describe('SilenceListComponent', () => {
let component: SilenceListComponent;
let fixture: ComponentFixture;
let prometheusService: PrometheusService;
configureTestBed({
imports: [
SharedModule,
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
ModalModule.forRoot(),
ToastrModule.forRoot(),
RouterTestingModule,
HttpClientTestingModule
],
declarations: [SilenceListComponent, PrometheusTabsComponent],
providers: [i18nProviders]
});
beforeEach(() => {
fixture = TestBed.createComponent(SilenceListComponent);
component = fixture.componentInstance;
prometheusService = TestBed.get(PrometheusService);
});
it('should create', () => {
fixture.detectChanges();
expect(component).toBeTruthy();
disk_usage: 0
}
],
pool_name: 'rbd'
}
];
configureTestBed(
{
declarations: [IscsiTargetFormComponent],
imports: [
SharedModule,
ReactiveFormsModule,
HttpClientTestingModule,
RouterTestingModule,
ToastrModule.forRoot()
],
providers: [
i18nProviders,
{
provide: ActivatedRoute,
useValue: new ActivatedRouteStub({ target_iqn: undefined })
}
]
},
true
);
beforeEach(() => {
fixture = TestBed.createComponent(IscsiTargetFormComponent);
component = fixture.componentInstance;
httpTesting = TestBed.get(HttpTestingController);
NgxDygraphsComponent,
ChartConfigComponent,
DialogListItem
],
imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
routing,
MaterialModule,
BrowserAnimationsModule,
ColorPickerModule,
Ng5SliderModule,
MatSelectSearchModule,
ToastrModule.forRoot({
timeOut: 3000,
positionClass: "toast-bottom-right",
preventDuplicates: false
}),
DndModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: createTranslateLoader,
deps: [HttpClient]
}
})
],
providers: [
HmiService,
ProjectService,
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ChatComponent],
imports: [FormsModule, ToastrModule.forRoot(), BrowserAnimationsModule],
}).compileComponents();
}));