import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ConfigService } from '@arrow/bom/config'; import { AnalyticsService, BomService, CoreModule, DialogService } from '@arrow/bom/core'; import { FeatureFlagService } from '@arrow/bom/feature-flag'; import { TranslateService } from '@ngx-translate/core'; import { SettingsComponent } from './settings.component'; import { SettingsService } from './settings.service'; describe('SettingComponent', () => { let component: SettingsComponent; let fixture: ComponentFixture; beforeEach(() => { const settingsServiceSpyObj = jasmine.createSpyObj('SettingsService', ['getSettings']); const dialogServiceSpyObj = jasmine.createSpyObj('DialogService', ['alert', 'confirm']); const configServiceSpyObj = jasmine.createSpyObj('ConfigService', ['getTarget']); const translateServiceSpyObj = jasmine.createSpyObj('TranslateService', ['instant']); const bomServiceSpyObj = jasmine.createSpyObj('BomService', ['deleteBom']); const featureFlagServiceSpyObj = jasmine.createSpyObj('FeatureFlagService', ['getLocalFlag']); TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA], imports: [ CoreModule ], // exports ObjOwnPropsPipe declarations: [ SettingsComponent ], providers: [ { provide: SettingsService, useValue: settingsServiceSpyObj }, { provide: ConfigService, useValue: configServiceSpyObj }, { provide: DialogService, useValue: dialogServiceSpyObj }, { provide: AnalyticsService, useValue: {} }, { provide: TranslateService, useValue: translateServiceSpyObj }, { provide: BomService, useValue: bomServiceSpyObj }, { provide: FeatureFlagService, useValue: featureFlagServiceSpyObj } ] }).compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(SettingsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); it('should create', () => { expect(component).toBeTruthy(); }); });