Skip to content
Snippets Groups Projects
Commit 1126af6b authored by Kristof De Langhe's avatar Kristof De Langhe
Browse files

56434: By.css call by tag instead of class refactoring

parent e39879b7
Branches
Tags
No related merge requests found
<ds-metadata-field-wrapper [label]="label | translate">
<a *ngFor="let metadatum of values; let last=last;" [href]="metadatum.value" class="metadata-value-links">
{{ linktext || metadatum.value }}<span *ngIf="!last" class="metadata-value-separator" [innerHTML]="separator"></span>
<a *ngFor="let metadatum of values; let last=last;" [href]="metadatum.value">
{{ linktext || metadatum.value }}<span *ngIf="!last" [innerHTML]="separator"></span>
</a>
</ds-metadata-field-wrapper>
......@@ -57,14 +57,14 @@ describe('MetadataUriValuesComponent', () => {
});
it('should contain the correct hrefs', () => {
const links = fixture.debugElement.queryAll(By.css('.metadata-value-links'));
const links = fixture.debugElement.queryAll(By.css('a'));
for (const metadatum of mockMetadata) {
expect(containsHref(links, metadatum.value)).toBeTruthy();
}
});
it('should contain separators equal to the amount of metadata values minus one', () => {
const separators = fixture.debugElement.queryAll(By.css('.metadata-value-separator'));
const separators = fixture.debugElement.queryAll(By.css('a span'));
expect(separators.length).toBe(mockMetadata.length - 1);
});
......@@ -76,7 +76,7 @@ describe('MetadataUriValuesComponent', () => {
});
it('should replace the metadata value with the linktext', () => {
const link = fixture.debugElement.query(By.css('.metadata-value-links'));
const link = fixture.debugElement.query(By.css('a'));
expect(link.nativeElement.textContent).toContain(mockLinkText);
});
......
<ds-metadata-field-wrapper [label]="label | translate">
<span *ngFor="let metadatum of values; let last=last;">
{{metadatum.value}}<span *ngIf="!last" class="metadata-value-separator" [innerHTML]="separator"></span>
{{metadatum.value}}<span *ngIf="!last" [innerHTML]="separator"></span>
</span>
</ds-metadata-field-wrapper>
......@@ -60,7 +60,7 @@ describe('MetadataValuesComponent', () => {
});
it('should contain separators equal to the amount of metadata values minus one', () => {
const separators = fixture.debugElement.queryAll(By.css('.metadata-value-separator'));
const separators = fixture.debugElement.queryAll(By.css('span>span'));
expect(separators.length).toBe(mockMetadata.length - 1);
});
......
<h2 *ngIf="!disableHeader" class="search-results-title">{{ getTitleKey() | translate }}</h2>
<h2 *ngIf="!disableHeader">{{ getTitleKey() | translate }}</h2>
<div *ngIf="searchResults?.hasSucceeded && !searchResults?.isLoading && searchResults?.payload?.page.length > 0" @fadeIn>
<ds-viewable-collection
[config]="searchConfig.pagination"
......
......@@ -24,7 +24,7 @@ describe('SearchResultsComponent', () => {
fixture = TestBed.createComponent(SearchResultsComponent);
comp = fixture.componentInstance; // SearchFormComponent test instance
heading = fixture.debugElement.query(By.css('heading'));
title = fixture.debugElement.query(By.css('.search-results-title'));
title = fixture.debugElement.query(By.css('h2'));
});
describe('when results are not empty', () => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment