import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ServiceWorkerModule } from '@angular/service-worker';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { NotificationService } from '@progress/kendo-angular-notification';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DatePipe, DecimalPipe, HashLocationStrategy, LocationStrategy } from '@angular/common';
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

import { AppComponent } from './app.component';
import { AlertComponent } from './components/alert';
import { UpdateService } from './update.service';
import { SignalRService } from './signalR.service';
import { AppRoutesModule } from './app.routes.module';
import { BreadcrumbService } from './breadcrumb.service';
import { AppTopBarComponent } from './app.topbar.component';
import { AppFooterComponent } from './app.footer.component';
import { ServicesModule } from '../providers/services.module';
import { AppBreadcrumbComponent } from './app.breadcrumb.component';
import { InterceptorService } from '../providers/interceptor.service';
import { FunctionService } from './components/models/function.service';
import { AppMenuComponent, AppSubMenuComponent } from './app.menu.component';
import { AccessDeniedComponent } from './accessdenied/accessdenied.component';
import { PageNotFoundComponent } from './pagenotfound/pagenotfound.component';

describe('AppComponent', () =>
{
  beforeEach(waitForAsync(() =>
  {
    TestBed.configureTestingModule({
    imports: [
        BrowserModule,
        ServicesModule,
        AlertComponent,
        BrowserAnimationsModule,
        AppRoutesModule,
        AppMenuComponent,
        AppSubMenuComponent,
        AppBreadcrumbComponent,
        AppTopBarComponent,
        AppFooterComponent,
        AccessDeniedComponent,
        PageNotFoundComponent,
        ServiceWorkerModule.register('ngsw-worker.js', { enabled: false }),
    ],
    providers: [
        provideHttpClient(withInterceptorsFromDi()),
        { provide: HTTP_INTERCEPTORS, useClass: InterceptorService, multi: true },
        { provide: LocationStrategy, useClass: HashLocationStrategy },
        DatePipe,
        DecimalPipe,
        BreadcrumbService,
        FunctionService,
        UpdateService,
        SignalRService,
        NotificationService
    ],
    schemas: [
        CUSTOM_ELEMENTS_SCHEMA
    ]
}).compileComponents();
  }));
  it('Component created successfully...', waitForAsync(() =>
  {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const app = fixture.debugElement.componentInstance;
    expect(app).toBeTruthy();
  }));
});
