1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: uri decode breadcrumbs (#6557)

This commit is contained in:
Mateusz Kwasniewski 2024-03-14 15:59:44 +01:00 committed by GitHub
parent 98c1c101ee
commit 05c014cde7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,22 @@
import { render } from 'utils/testRenderer';
import { Route, Routes } from 'react-router-dom';
import BreadcrumbNav from './BreadcrumbNav';
import { screen } from '@testing-library/react';
test('decode URI encoded path in breadcrumbs nav', async () => {
render(
<Routes>
<Route
path={'/applications/:name/:instance'}
element={<BreadcrumbNav />}
/>
</Routes>,
{
route: '/applications/my%20app/my%20instance',
},
);
await screen.findByText('applications');
await screen.findByText('my app');
await screen.findByText('my instance');
});

View File

@ -49,7 +49,8 @@ const BreadcrumbNav = () => {
item !== 'create-toggle' &&
item !== 'settings' &&
item !== 'profile',
);
)
.map(decodeURI);
return (
<StyledBreadcrumbContainer>