Removed deprecated helper function async

This commit is contained in:
Giuseppe Digilio
2021-01-07 20:12:15 +01:00
parent 4d4e920f0d
commit e5af894077
418 changed files with 2114 additions and 1912 deletions

View File

@@ -1,5 +1,5 @@
import { ChangeDetectionStrategy, Injector, NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { Router } from '@angular/router';
import { By } from '@angular/platform-browser';
@@ -72,7 +72,7 @@ const rd = createSuccessfulRemoteDataObject(item);
mockObject = Object.assign(new WorkspaceItem(), { item: observableOf(rd), id: '1234', uuid: '1234' });
describe('WorkspaceitemActionsComponent', () => {
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
@@ -150,8 +150,8 @@ describe('WorkspaceitemActionsComponent', () => {
});
it('should display a success notification on delete success', async(() => {
spyOn((component as any).modalService, 'open').and.returnValue({result: Promise.resolve('ok')});
it('should display a success notification on delete success', waitForAsync(() => {
spyOn((component as any).modalService, 'open').and.returnValue({ result: Promise.resolve('ok') });
mockDataService.delete.and.returnValue(createSuccessfulRemoteDataObject$({}));
spyOn(component, 'reload');
@@ -163,8 +163,8 @@ describe('WorkspaceitemActionsComponent', () => {
});
}));
it('should display an error notification on delete failure', async(() => {
spyOn((component as any).modalService, 'open').and.returnValue({result: Promise.resolve('ok')});
it('should display an error notification on delete failure', waitForAsync(() => {
spyOn((component as any).modalService, 'open').and.returnValue({ result: Promise.resolve('ok') });
mockDataService.delete.and.returnValue(createFailedRemoteDataObject$('Error', 500));
spyOn(component, 'reload');
@@ -176,7 +176,7 @@ describe('WorkspaceitemActionsComponent', () => {
});
}));
it('should clear the object cache by href', async(() => {
it('should clear the object cache by href', waitForAsync(() => {
component.reload();
fixture.detectChanges();