From b7557051f22846eb2e98317c4516b2452bc612b1 Mon Sep 17 00:00:00 2001 From: Martin <git@mail.de> Date: Thu, 6 Mar 2025 12:42:11 +0100 Subject: [PATCH] decode uri on expectation due to angulars intern transformations of special character --- .../src/lib/list/list-item/list-item.component.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alfa-client/libs/design-system/src/lib/list/list-item/list-item.component.spec.ts b/alfa-client/libs/design-system/src/lib/list/list-item/list-item.component.spec.ts index 2e2714f6cf..fff8eddf20 100644 --- a/alfa-client/libs/design-system/src/lib/list/list-item/list-item.component.spec.ts +++ b/alfa-client/libs/design-system/src/lib/list/list-item/list-item.component.spec.ts @@ -24,7 +24,7 @@ import { getElementFromFixture } from '@alfa-client/test-utils'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; -import { faker } from '@faker-js/faker'; +import { faker } from '@faker-js/faker/.'; import { getDataTestClassOf } from 'libs/tech-shared/test/data-test'; import { ListItemComponent } from './list-item.component'; @@ -52,12 +52,12 @@ describe('ListItemComponent', () => { describe('input', () => { describe('routerLink', () => { it('should set href attribute', () => { - component.path = faker.system.filePath(); + component.path = encodeURIComponent(faker.system.filePath()); fixture.detectChanges(); const linkElement: HTMLLinkElement = getElementFromFixture(fixture, link); - expect(linkElement.href).toBe(`http://localhost${component.path}`); + expect(decodeURIComponent(linkElement.href)).toBe(`http://localhost/${component.path}`); }); }); }); -- GitLab