Skip to content

Commit 8e48aa9

Browse files
author
FrancescoMauto
committed
[DSC-2901] fix: tests
1 parent 9cae799 commit 8e48aa9

4 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/orcid/orcid.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ describe('OrcidComponent', () => {
119119
expect(spanValueFound.length).toBe(1);
120120
expect(spanValueFound[0].nativeElement.textContent).toContain('0000-0001-8918-3592');
121121

122-
const orcidLinkFound = fixture.debugElement.queryAll(By.css('a'));
122+
const orcidLinkFound = fixture.debugElement.queryAll(By.css('span.txt-value > a'));
123123
expect(orcidLinkFound.length).toBe(1);
124124
expect(orcidLinkFound[0].nativeElement.href).toBe('https://sandbox.orcid.org/0000-0001-8918-3592');
125125

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/orcid/orcid.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { AsyncPipe } from '@angular/common';
1+
import {
2+
AsyncPipe,
3+
NgIf,
4+
} from '@angular/common';
25
import {
36
Component,
47
Inject,
@@ -31,6 +34,7 @@ import { RenderingTypeValueModelComponent } from '../rendering-type-value.model'
3134
standalone: true,
3235
imports: [
3336
AsyncPipe,
37+
NgIf,
3438
OrcidBadgeAndTooltipComponent,
3539
TranslateModule,
3640
],

src/app/shared/orcid-badge-and-tooltip/orcid-badge-and-tooltip.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class="orcid-link">
66
<img placement="top"
77
[ngbTooltip]="orcidTooltipTemplate"
8-
class="orcid-icon"
8+
class="orcid-icon" [ngClass]="{'not-authenticated': !authenticatedTimestamp}"
99
alt="ORCID {{ orcidTooltip }}"
1010
[src]="authenticatedTimestamp ? 'assets/images/orcid.logo.icon.svg': 'assets/images/orcid.logo.unauth.icon.svg'"
1111
data-test="orcidIcon"/>

src/app/shared/orcid-badge-and-tooltip/orcid-badge-and-tooltip.component.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@
44

55
.orcid-icon {
66
height: 1.2rem;
7-
}
7+
8+
&.not-authenticated {
9+
filter: grayscale(100%);
10+
}
11+
}

0 commit comments

Comments
 (0)