Skip to content

Commit bba6971

Browse files
Fixed new failing tests
1 parent b577120 commit bba6971

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/app/community-page/sections/sub-com-col-section/sub-collection-list/community-page-sub-collection-list.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { TranslateModule } from '@ngx-translate/core';
3-
import { NO_ERRORS_SCHEMA } from '@angular/core';
3+
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
44
import { By } from '@angular/platform-browser';
55
import { RouterTestingModule } from '@angular/router/testing';
66
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
@@ -183,7 +183,7 @@ describe('CommunityPageSubCollectionListComponent', () => {
183183
await fixture.whenStable();
184184
fixture.detectChanges();
185185

186-
const collList = fixture.debugElement.queryAll(By.css('li'));
186+
const collList: DebugElement[] = fixture.debugElement.queryAll(By.css('ul[data-test="objects"] li'));
187187
expect(collList.length).toEqual(5);
188188
expect(collList[0].nativeElement.textContent).toContain('Collection 1');
189189
expect(collList[1].nativeElement.textContent).toContain('Collection 2');

src/app/community-page/sections/sub-com-col-section/sub-community-list/community-page-sub-community-list.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
22
import { TranslateModule } from '@ngx-translate/core';
3-
import { NO_ERRORS_SCHEMA } from '@angular/core';
3+
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
44
import { RouterTestingModule } from '@angular/router/testing';
55
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
66
import { By } from '@angular/platform-browser';
@@ -185,7 +185,7 @@ describe('CommunityPageSubCommunityListComponent', () => {
185185
await fixture.whenStable();
186186
fixture.detectChanges();
187187

188-
const subComList = fixture.debugElement.queryAll(By.css('li'));
188+
const subComList: DebugElement[] = fixture.debugElement.queryAll(By.css('ul[data-test="objects"] li'));
189189
expect(subComList.length).toEqual(5);
190190
expect(subComList[0].nativeElement.textContent).toContain('SubCommunity 1');
191191
expect(subComList[1].nativeElement.textContent).toContain('SubCommunity 2');

src/app/shared/object-list/object-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
(paginationChange)="onPaginationChange($event)"
1616
(prev)="goPrev()"
1717
(next)="goNext()">
18-
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}">
18+
<ul *ngIf="objects?.hasSucceeded" class="list-unstyled" [ngClass]="{'ml-4': selectable}" data-test="objects">
1919
<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">
2020
<ds-selectable-list-item-control *ngIf="selectable" [index]="i"
2121
[object]="object"

0 commit comments

Comments
 (0)