Skip to content
Snippets Groups Projects
Commit b7557051 authored by Martin's avatar Martin
Browse files

decode uri on expectation due to angulars intern transformations of special character

parent 33f40722
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
import { getElementFromFixture } from '@alfa-client/test-utils'; import { getElementFromFixture } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideRouter } from '@angular/router'; 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 { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
import { ListItemComponent } from './list-item.component'; import { ListItemComponent } from './list-item.component';
...@@ -52,12 +52,12 @@ describe('ListItemComponent', () => { ...@@ -52,12 +52,12 @@ describe('ListItemComponent', () => {
describe('input', () => { describe('input', () => {
describe('routerLink', () => { describe('routerLink', () => {
it('should set href attribute', () => { it('should set href attribute', () => {
component.path = faker.system.filePath(); component.path = encodeURIComponent(faker.system.filePath());
fixture.detectChanges(); fixture.detectChanges();
const linkElement: HTMLLinkElement = getElementFromFixture(fixture, link); const linkElement: HTMLLinkElement = getElementFromFixture(fixture, link);
expect(linkElement.href).toBe(`http://localhost${component.path}`); expect(decodeURIComponent(linkElement.href)).toBe(`http://localhost/${component.path}`);
}); });
}); });
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment