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.
13 lines
442 B
JavaScript
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/');
|
|
});
|
|
});
|