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 { CollectionGridElementComponent } from './collection-grid-element.component';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
import { Collection } from '../../../core/shared/collection.model';
@@ -35,21 +35,21 @@ const linkService = jasmine.createSpyObj('linkService', {
});
describe('CollectionGridElementComponent', () => {
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ CollectionGridElementComponent ],
declarations: [CollectionGridElementComponent],
providers: [
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract)},
{ provide: LinkService, useValue: linkService}
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
{ provide: LinkService, useValue: linkService }
],
schemas: [ NO_ERRORS_SCHEMA ]
schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(CollectionGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
}).compileComponents();
}));
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(CollectionGridElementComponent);
collectionGridElementComponent = fixture.componentInstance;
}));

View File

@@ -1,5 +1,5 @@
import { CommunityGridElementComponent } from './community-grid-element.component';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';
import { Community } from '../../../core/shared/community.model';
@@ -35,21 +35,21 @@ const linkService = jasmine.createSpyObj('linkService', {
});
describe('CommunityGridElementComponent', () => {
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ CommunityGridElementComponent ],
declarations: [CommunityGridElementComponent],
providers: [
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract)},
{ provide: LinkService, useValue: linkService}
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) },
{ provide: LinkService, useValue: linkService }
],
schemas: [ NO_ERRORS_SCHEMA ]
schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(CommunityGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
}).compileComponents();
}));
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(CommunityGridElementComponent);
communityGridElementComponent = fixture.componentInstance;
}));

View File

@@ -1,5 +1,5 @@
import { DebugElement } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Bitstream } from '../../../core/shared/bitstream.model';
import { SafeUrlPipe } from '../../utils/safe-url-pipe';
@@ -12,7 +12,7 @@ describe('GridThumbnailComponent', () => {
let de: DebugElement;
let el: HTMLElement;
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [GridThumbnailComponent, SafeUrlPipe]
}).compileComponents();

View File

@@ -1,4 +1,4 @@
import { async, TestBed } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { TruncatePipe } from '../../../../utils/truncate.pipe';
import { TruncatableService } from '../../../../truncatable/truncatable.service';
@@ -49,7 +49,7 @@ describe('ItemGridElementComponent', () => {
isCollapsed: (id: number) => observableOf(true),
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [NoopAnimationsModule],
declarations: [ItemGridElementComponent, TruncatePipe],
@@ -62,7 +62,7 @@ describe('ItemGridElementComponent', () => {
}).compileComponents();
}));
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(ItemGridElementComponent);
comp = fixture.componentInstance;
}));

View File

@@ -132,11 +132,13 @@ describe('ObjectGridComponent', () => {
comp.ngOnInit();
const expected = cold('c', { c: [
const expected = cold('c', {
c: [
[testObjects[0], testObjects[3], testObjects[6], testObjects[9]],
[testObjects[1], testObjects[4], testObjects[7]],
[testObjects[2], testObjects[5], testObjects[8]]
] });
]
});
const result = comp.columns$;
@@ -153,11 +155,13 @@ describe('ObjectGridComponent', () => {
comp.ngOnInit();
const expected = cold('c', { c: [
const expected = cold('c', {
c: [
[testObjects[0], testObjects[3], testObjects[6], testObjects[9]],
[testObjects[1], testObjects[4], testObjects[7]],
[testObjects[2], testObjects[5], testObjects[8]]
] });
]
});
const result = comp.columns$;
@@ -174,10 +178,12 @@ describe('ObjectGridComponent', () => {
comp.ngOnInit();
const expected = cold('c', { c: [
const expected = cold('c', {
c: [
[testObjects[0], testObjects[2], testObjects[4], testObjects[6], testObjects[8]],
[testObjects[1], testObjects[3], testObjects[5], testObjects[7], testObjects[9]],
] });
]
});
const result = comp.columns$;
@@ -194,10 +200,12 @@ describe('ObjectGridComponent', () => {
comp.ngOnInit();
const expected = cold('c', { c: [
const expected = cold('c', {
c: [
[testObjects[0], testObjects[2], testObjects[4], testObjects[6], testObjects[8]],
[testObjects[1], testObjects[3], testObjects[5], testObjects[7], testObjects[9]],
] });
]
});
const result = comp.columns$;
@@ -214,7 +222,7 @@ describe('ObjectGridComponent', () => {
comp.ngOnInit();
const expected = cold('c', { c: [ testObjects ] });
const expected = cold('c', { c: [testObjects] });
const result = comp.columns$;

View File

@@ -1,6 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Store } from '@ngrx/store';
import { of as observableOf } from 'rxjs';
@@ -58,9 +58,9 @@ const linkService = jasmine.createSpyObj('linkService', {
});
describe('CollectionSearchResultGridElementComponent', () => {
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ CollectionSearchResultGridElementComponent, TruncatePipe ],
declarations: [CollectionSearchResultGridElementComponent, TruncatePipe],
providers: [
{ provide: TruncatableService, useValue: truncatableServiceStub },
{ provide: 'objectElementProvider', useValue: (mockCollectionWithAbstract) },
@@ -76,16 +76,16 @@ describe('CollectionSearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService}
{ provide: LinkService, useValue: linkService }
],
schemas: [ NO_ERRORS_SCHEMA ]
schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(CollectionSearchResultGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
}).compileComponents();
}));
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(CollectionSearchResultGridElementComponent);
collectionSearchResultGridElementComponent = fixture.componentInstance;
}));

View File

@@ -1,6 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { Store } from '@ngrx/store';
import { of as observableOf } from 'rxjs';
@@ -58,9 +58,9 @@ const linkService = jasmine.createSpyObj('linkService', {
});
describe('CommunitySearchResultGridElementComponent', () => {
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ CommunitySearchResultGridElementComponent, TruncatePipe ],
declarations: [CommunitySearchResultGridElementComponent, TruncatePipe],
providers: [
{ provide: TruncatableService, useValue: truncatableServiceStub },
{ provide: 'objectElementProvider', useValue: (mockCommunityWithAbstract) },
@@ -76,16 +76,16 @@ describe('CommunitySearchResultGridElementComponent', () => {
{ provide: DSOChangeAnalyzer, useValue: {} },
{ provide: DefaultChangeAnalyzer, useValue: {} },
{ provide: BitstreamFormatDataService, useValue: {} },
{ provide: LinkService, useValue: linkService}
{ provide: LinkService, useValue: linkService }
],
schemas: [ NO_ERRORS_SCHEMA ]
schemas: [NO_ERRORS_SCHEMA]
}).overrideComponent(CommunitySearchResultGridElementComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default }
}).compileComponents();
}));
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(CommunitySearchResultGridElementComponent);
communitySearchResultGridElementComponent = fixture.componentInstance;
}));

View File

@@ -1,6 +1,6 @@
import { HttpClient } from '@angular/common/http';
import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core';
import { async, TestBed } from '@angular/core/testing';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { Store } from '@ngrx/store';
@@ -97,7 +97,7 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet
}
};
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [NoopAnimationsModule],
declarations: [component, TruncatePipe],
@@ -121,7 +121,7 @@ export function getEntityGridElementTestComponent(component, searchResultWithMet
}).compileComponents();
}));
beforeEach(async(() => {
beforeEach(waitForAsync(() => {
fixture = TestBed.createComponent(component);
comp = fixture.componentInstance;
}));