mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
Fixed new failing tests
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
@@ -183,7 +183,7 @@ describe('CommunityPageSubCollectionListComponent', () => {
|
|||||||
await fixture.whenStable();
|
await fixture.whenStable();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
const collList = fixture.debugElement.queryAll(By.css('li'));
|
const collList: DebugElement[] = fixture.debugElement.queryAll(By.css('ul[data-test="objects"] li'));
|
||||||
expect(collList.length).toEqual(5);
|
expect(collList.length).toEqual(5);
|
||||||
expect(collList[0].nativeElement.textContent).toContain('Collection 1');
|
expect(collList[0].nativeElement.textContent).toContain('Collection 1');
|
||||||
expect(collList[1].nativeElement.textContent).toContain('Collection 2');
|
expect(collList[1].nativeElement.textContent).toContain('Collection 2');
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { RouterTestingModule } from '@angular/router/testing';
|
import { RouterTestingModule } from '@angular/router/testing';
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
@@ -185,7 +185,7 @@ describe('CommunityPageSubCommunityListComponent', () => {
|
|||||||
await fixture.whenStable();
|
await fixture.whenStable();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
const subComList = fixture.debugElement.queryAll(By.css('li'));
|
const subComList: DebugElement[] = fixture.debugElement.queryAll(By.css('ul[data-test="objects"] li'));
|
||||||
expect(subComList.length).toEqual(5);
|
expect(subComList.length).toEqual(5);
|
||||||
expect(subComList[0].nativeElement.textContent).toContain('SubCommunity 1');
|
expect(subComList[0].nativeElement.textContent).toContain('SubCommunity 1');
|
||||||
expect(subComList[1].nativeElement.textContent).toContain('SubCommunity 2');
|
expect(subComList[1].nativeElement.textContent).toContain('SubCommunity 2');
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
(paginationChange)="onPaginationChange($event)"
|
(paginationChange)="onPaginationChange($event)"
|
||||||
(prev)="goPrev()"
|
(prev)="goPrev()"
|
||||||
(next)="goNext()">
|
(next)="goNext()">
|
||||||
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}">
|
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}" data-test="objects">
|
||||||
<li *ngFor="let object of objects?.payload?.page; let i = index; let last = last" class="mt-4 mb-4 d-flex" [class.border-bottom]="hasBorder && !last" [attr.data-test]="'list-object' | dsBrowserOnly">
|
<li *ngFor="let object of objects?.payload?.page; let i = index; let last = last" class="mt-4 mb-4 d-flex" [class.border-bottom]="hasBorder && !last" [attr.data-test]="'list-object' | dsBrowserOnly">
|
||||||
<ds-selectable-list-item-control *ngIf="selectable" [index]="i"
|
<ds-selectable-list-item-control *ngIf="selectable" [index]="i"
|
||||||
[object]="object"
|
[object]="object"
|
||||||
|
Reference in New Issue
Block a user