Skip to content

Commit edcb00f

Browse files
KasinhouMatus Kasak
andauthored
ZCU-DATA/Cherry-pick Fix duplicate id (#1240)
* Changed id to class * Fix duplicate id license_option --------- Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk>
1 parent 7d7b6d9 commit edcb00f

4 files changed

Lines changed: 7 additions & 8 deletions

File tree

cypress/e2e/header.cy.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ describe('Header', () => {
1212
// testA11y({
1313
// include: ['ds-header'],
1414
// exclude: [
15-
// ['#search-navbar-container'], // search in navbar has duplicative ID. Will be fixed in #1174
1615
// ['.dropdownLogin'] // "Log in" link has color contrast issues. Will be fixed in #1149
1716
// ],
1817
// });

src/app/search-navbar/search-navbar.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="search-navbar-container" [title]="'nav.search' | translate" (dsClickOutside)="collapse()">
1+
<div class="search-navbar-container" [title]="'nav.search' | translate" (dsClickOutside)="collapse()">
22
<div class="d-inline-block position-relative">
33
<form [formGroup]="searchForm" (ngSubmit)="onSubmit(searchForm.value)" autocomplete="on" class="d-flex">
44
<input #searchInput [@toggleAnimation]="isExpanded" [attr.aria-label]="('nav.search' | translate)" name="query"

src/app/search-navbar/search-navbar.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('SearchNavbarComponent', () => {
7272
spyOn(component, 'expand').and.callThrough();
7373
spyOn(component, 'onSubmit').and.callThrough();
7474
spyOn(router, 'navigate');
75-
const searchIcon = fixture.debugElement.query(By.css('#search-navbar-container form .submit-icon'));
75+
const searchIcon = fixture.debugElement.query(By.css('.search-navbar-container form .submit-icon'));
7676
searchIcon.triggerEventHandler('click', {
7777
preventDefault: () => {/**/
7878
}
@@ -88,7 +88,7 @@ describe('SearchNavbarComponent', () => {
8888
describe('empty query', () => {
8989
describe('press submit button', () => {
9090
beforeEach(fakeAsync(() => {
91-
const searchIcon = fixture.debugElement.query(By.css('#search-navbar-container form .submit-icon'));
91+
const searchIcon = fixture.debugElement.query(By.css('.search-navbar-container form .submit-icon'));
9292
searchIcon.triggerEventHandler('click', {
9393
preventDefault: () => {/**/
9494
}
@@ -109,14 +109,14 @@ describe('SearchNavbarComponent', () => {
109109
beforeEach(async () => {
110110
await fixture.whenStable();
111111
fixture.detectChanges();
112-
searchInput = fixture.debugElement.query(By.css('#search-navbar-container form input'));
112+
searchInput = fixture.debugElement.query(By.css('.search-navbar-container form input'));
113113
searchInput.nativeElement.value = 'test';
114114
searchInput.nativeElement.dispatchEvent(new Event('input'));
115115
fixture.detectChanges();
116116
});
117117
describe('press submit button', () => {
118118
beforeEach(fakeAsync(() => {
119-
const searchIcon = fixture.debugElement.query(By.css('#search-navbar-container form .submit-icon'));
119+
const searchIcon = fixture.debugElement.query(By.css('.search-navbar-container form .submit-icon'));
120120
searchIcon.triggerEventHandler('click', null);
121121
tick();
122122
fixture.detectChanges();

src/app/submission/sections/clarin-license-resource/section-license.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@
6464
<li class="dropdown-item clarin-dropdown-item pt-2" value="0" (click)="selectLicense(0)">
6565
<b>{{'submission.sections.clarin-license.head.license-select-default-value' | translate}}</b>
6666
</li>
67-
<li class="dropdown-item clarin-dropdown-item pt-2"
67+
<li class="dropdown-item clarin-dropdown-item pt-2 license-option"
6868
*ngFor="let license of filteredLicenses4Selector"
6969
(click)="selectLicense(license.id)"
7070
[value]="license.id"
71-
id="license_option">
71+
[id]="'license_option_' + license.id">
7272
<span [class]="'label label-default label-' + license.licenseLabel">{{license.licenseLabel}}</span>
7373
<b class="pl-1">{{license.name}}</b>
7474
</li>

0 commit comments

Comments
 (0)