debian-image-builder-frontend/src/entry.test.js
Sanne Raymaekers 03421acc74 src/Router: use release as a basename in BrowserRouter
The insights platform is moving to react router v6, meaning router
contexts can no longer be nested. As a result all applications will end
up sharing the same `BrowserRouter`.

Switch to using the release (`/` or `/beta/`) as a basename for the
BrowserRouter, and offload the full path (`/insights/$appname`) to the
individual routes. This makes it easier to drop the BrowserRouter in
image builder for the platform one in future.
2022-10-17 15:53:21 +02:00

13 lines
442 B
JavaScript

import { getBaseName } from './Utilities/path';
describe('Utilities/getBaseName', () => {
it('should find the right base name on Stable ', () => {
expect(getBaseName('/')).toEqual('/');
expect(getBaseName('/rhcs/bar/bar/baz')).toEqual('/');
});
it('should find the right base name on Beta ', () => {
expect(getBaseName('/beta')).toEqual('/beta/');
expect(getBaseName('/beta/foo/bar/baz')).toEqual('/beta/');
});
});