We no longer need this and it was causing unexpected results in some tests.
Fixes: https://tracker.ceph.com/issues/46500
Signed-off-by: Tiago Melo <tmelo@suse.com>
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
+import { configureTestBed } from '../testing/unit-test-helper';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [AppComponent],
- imports: [RouterTestingModule]
- }).compileComponents();
- }));
+ configureTestBed({
+ declarations: [AppComponent],
+ imports: [RouterTestingModule]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
expect(component).toBeTruthy();
});
- it('should render hosts list even with not permission mapped services', async(() => {
+ it('should render hosts list even with not permission mapped services', () => {
const hostname = 'ceph.dev';
const payload = [
{
hostListSpy.and.callFake(() => of(payload));
- fixture.whenStable().then(() => {
+ return fixture.whenStable().then(() => {
fixture.detectChanges();
const spans = fixture.debugElement.nativeElement.querySelectorAll(
);
expect(spans[0].textContent).toBe(hostname);
});
- }));
+ });
describe('getEditDisableDesc', () => {
it('should return message (not managed by Orchestrator)', () => {
import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
-import { i18nProviders } from '../../../../testing/unit-test-helper';
+import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper';
import { SharedModule } from '../../../shared/shared.module';
import { DeviceListComponent } from './device-list.component';
let component: DeviceListComponent;
let fixture: ComponentFixture<DeviceListComponent>;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [DeviceListComponent],
- imports: [SharedModule, HttpClientTestingModule],
- providers: [i18nProviders]
- }).compileComponents();
- }));
+ configureTestBed({
+ declarations: [DeviceListComponent],
+ imports: [SharedModule, HttpClientTestingModule],
+ providers: [i18nProviders]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(DeviceListComponent);
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
import { BlankLayoutComponent } from './blank-layout.component';
describe('DefaultLayoutComponent', () => {
let component: BlankLayoutComponent;
let fixture: ComponentFixture<BlankLayoutComponent>;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [BlankLayoutComponent],
- imports: [RouterTestingModule]
- }).compileComponents();
- }));
+ configureTestBed({
+ declarations: [BlankLayoutComponent],
+ imports: [RouterTestingModule]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(BlankLayoutComponent);
import { HttpClientTestingModule } from '@angular/common/http/testing';
-import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';
+import { configureTestBed } from '../../../../testing/unit-test-helper';
import { SharedModule } from '../../../shared/shared.module';
import { LoginLayoutComponent } from './login-layout.component';
let component: LoginLayoutComponent;
let fixture: ComponentFixture<LoginLayoutComponent>;
- beforeEach(async(() => {
- TestBed.configureTestingModule({
- declarations: [LoginLayoutComponent],
- imports: [BrowserAnimationsModule, HttpClientTestingModule, RouterTestingModule, SharedModule]
- }).compileComponents();
- }));
+ configureTestBed({
+ declarations: [LoginLayoutComponent],
+ imports: [BrowserAnimationsModule, HttpClientTestingModule, RouterTestingModule, SharedModule]
+ });
beforeEach(() => {
fixture = TestBed.createComponent(LoginLayoutComponent);
},
"eofline": true,
"forin": true,
- "import-blacklist": [true, "rxjs/Rx"],
+ "import-blacklist": [true, "rxjs/Rx", {"@angular/core/testing": ["async"]}],
"import-spacing": true,
"indent": [true, "spaces"],
"interface-over-type-literal": true,