From e0db4284b3a502c2d6cc2a504a029f16f2957bc5 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 1 Jul 2023 13:19:28 +0200 Subject: [PATCH] Fix CollectionSearchResultListElementComponent no expectation tests - Wrong css class was used - The check to see if the offset was defined did not exist --- .../collection-search-result-list-element.component.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts index e5ea60b35d..5e5dbcd73b 100644 --- a/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts +++ b/src/app/shared/object-list/search-result-list-element/collection-search-result/collection-search-result-list-element.component.spec.ts @@ -1,7 +1,7 @@ import { CollectionSearchResultListElementComponent } from './collection-search-result-list-element.component'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { of as observableOf } from 'rxjs'; -import { ChangeDetectionStrategy, NO_ERRORS_SCHEMA } from '@angular/core'; +import { ChangeDetectionStrategy, DebugElement, NO_ERRORS_SCHEMA } from '@angular/core'; import { By } from '@angular/platform-browser'; import { TruncatePipe } from '../../../utils/truncate.pipe'; import { Collection } from '../../../../core/shared/collection.model'; @@ -98,7 +98,8 @@ describe('CollectionSearchResultListElementComponent', () => { describe('when environment is set to show thumbnail images', () => { it('should offset content', () => { - const offset = fixture.debugElement.query(By.css('offset-md-2')); + const offset: DebugElement = fixture.debugElement.query(By.css('.offset-md-2')); + expect(offset).not.toBeNull(); }); });