Skip to content

Commit 8dcf4e1

Browse files
committed
fixed tests to reflect the icon image src changes with authenticated timestamp
1 parent 33bf3e4 commit 8dcf4e1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/app/shared/orcid-badge-and-tooltip/orcid-badge-and-tooltip.component.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,16 @@ describe('OrcidBadgeAndTooltipComponent', () => {
6363
expect(badgeIcon).toBeTruthy();
6464
});
6565

66-
it('should display the ORCID icon in greyscale if there is no authenticated timestamp', () => {
66+
it('should display the filled green ORCID icon if there is an authenticated timestamp', () => {
67+
const badgeIcon = fixture.debugElement.query(By.css('img[data-test="orcidIcon"]'));
68+
expect(badgeIcon.nativeElement.getAttribute('src')).toEqual('assets/images/orcid.logo.icon.svg');
69+
});
70+
71+
it('should display the green unfilled ORCID icon if there is no authenticated timestamp', () => {
6772
component.authenticatedTimestamp = null;
6873
fixture.detectChanges();
6974
const badgeIcon = fixture.debugElement.query(By.css('img[data-test="orcidIcon"]'));
70-
expect(badgeIcon.nativeElement.classList).toContain('not-authenticated');
75+
expect(badgeIcon.nativeElement.getAttribute('src')).toEqual('assets/images/orcid.logo.unauth.icon.svg');
7176
});
7277

7378
});

0 commit comments

Comments
 (0)