mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fix TopLevelCommunityListComponent, CommunityPageSubCollectionListComponent, CommunityPageSubCommunityListComponent no expectation tests
Because their child components use a themed component the changes need to be detected twice, this is a side effect from the component being created dynamically
This commit is contained in:
@@ -30,7 +30,7 @@ import { ConfigurationProperty } from '../../core/shared/configuration-property.
|
||||
import { createPaginatedList } from '../../shared/testing/utils.test';
|
||||
import { SearchConfigurationServiceStub } from '../../shared/testing/search-configuration-service.stub';
|
||||
|
||||
describe('CommunityPageSubCollectionList Component', () => {
|
||||
describe('CommunityPageSubCollectionListComponent', () => {
|
||||
let comp: CommunityPageSubCollectionListComponent;
|
||||
let fixture: ComponentFixture<CommunityPageSubCollectionListComponent>;
|
||||
let collectionDataServiceStub: any;
|
||||
@@ -177,10 +177,11 @@ describe('CommunityPageSubCollectionList Component', () => {
|
||||
});
|
||||
|
||||
|
||||
it('should display a list of collections', () => {
|
||||
waitForAsync(() => {
|
||||
it('should display a list of collections', async () => {
|
||||
subCollList = collections;
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
|
||||
const collList = fixture.debugElement.queryAll(By.css('li'));
|
||||
expect(collList.length).toEqual(5);
|
||||
@@ -190,7 +191,6 @@ describe('CommunityPageSubCollectionList Component', () => {
|
||||
expect(collList[3].nativeElement.textContent).toContain('Collection 4');
|
||||
expect(collList[4].nativeElement.textContent).toContain('Collection 5');
|
||||
});
|
||||
});
|
||||
|
||||
it('should not display the header when list of collections is empty', () => {
|
||||
subCollList = [];
|
||||
|
@@ -30,7 +30,7 @@ import { SearchConfigurationServiceStub } from '../../shared/testing/search-conf
|
||||
import { ConfigurationProperty } from '../../core/shared/configuration-property.model';
|
||||
import { createPaginatedList } from '../../shared/testing/utils.test';
|
||||
|
||||
describe('CommunityPageSubCommunityListComponent Component', () => {
|
||||
describe('CommunityPageSubCommunityListComponent', () => {
|
||||
let comp: CommunityPageSubCommunityListComponent;
|
||||
let fixture: ComponentFixture<CommunityPageSubCommunityListComponent>;
|
||||
let communityDataServiceStub: any;
|
||||
@@ -179,10 +179,11 @@ describe('CommunityPageSubCommunityListComponent Component', () => {
|
||||
});
|
||||
|
||||
|
||||
it('should display a list of sub-communities', () => {
|
||||
waitForAsync(() => {
|
||||
it('should display a list of sub-communities', async () => {
|
||||
subCommList = subcommunities;
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
|
||||
const subComList = fixture.debugElement.queryAll(By.css('li'));
|
||||
expect(subComList.length).toEqual(5);
|
||||
@@ -192,7 +193,6 @@ describe('CommunityPageSubCommunityListComponent Component', () => {
|
||||
expect(subComList[3].nativeElement.textContent).toContain('SubCommunity 4');
|
||||
expect(subComList[4].nativeElement.textContent).toContain('SubCommunity 5');
|
||||
});
|
||||
});
|
||||
|
||||
it('should not display the header when list of sub-communities is empty', () => {
|
||||
subCommList = [];
|
||||
|
@@ -32,7 +32,7 @@ import { SearchConfigurationServiceStub } from '../../shared/testing/search-conf
|
||||
import { APP_CONFIG } from 'src/config/app-config.interface';
|
||||
import { environment } from 'src/environments/environment.test';
|
||||
|
||||
describe('TopLevelCommunityList Component', () => {
|
||||
describe('TopLevelCommunityListComponent', () => {
|
||||
let comp: TopLevelCommunityListComponent;
|
||||
let fixture: ComponentFixture<TopLevelCommunityListComponent>;
|
||||
let communityDataServiceStub: any;
|
||||
@@ -173,8 +173,9 @@ describe('TopLevelCommunityList Component', () => {
|
||||
});
|
||||
|
||||
|
||||
it('should display a list of top-communities', () => {
|
||||
waitForAsync(() => {
|
||||
it('should display a list of top-communities', async () => {
|
||||
await fixture.whenStable();
|
||||
fixture.detectChanges();
|
||||
const subComList = fixture.debugElement.queryAll(By.css('li'));
|
||||
|
||||
expect(subComList.length).toEqual(5);
|
||||
@@ -184,6 +185,5 @@ describe('TopLevelCommunityList Component', () => {
|
||||
expect(subComList[3].nativeElement.textContent).toContain('TopCommunity 4');
|
||||
expect(subComList[4].nativeElement.textContent).toContain('TopCommunity 5');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user