mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Use real appBasePath in legacy AppService shim (#51353)
This commit is contained in:
parent
aeb082e7c2
commit
1da0dc8aec
2 changed files with 8 additions and 3 deletions
|
@ -18,13 +18,15 @@
|
|||
*/
|
||||
|
||||
import { setRootControllerMock } from './new_platform.test.mocks';
|
||||
import { legacyAppRegister, __reset__ } from './new_platform';
|
||||
import { legacyAppRegister, __reset__, __setup__ } from './new_platform';
|
||||
import { coreMock } from '../../../../core/public/mocks';
|
||||
|
||||
describe('ui/new_platform', () => {
|
||||
describe('legacyAppRegister', () => {
|
||||
beforeEach(() => {
|
||||
setRootControllerMock.mockReset();
|
||||
__reset__();
|
||||
__setup__(coreMock.createSetup({ basePath: '/test/base/path' }) as any, {} as any);
|
||||
});
|
||||
|
||||
const registerApp = () => {
|
||||
|
@ -59,7 +61,7 @@ describe('ui/new_platform', () => {
|
|||
controller(scopeMock, elementMock);
|
||||
expect(mountMock).toHaveBeenCalledWith(expect.any(Object), {
|
||||
element: elementMock[0],
|
||||
appBasePath: '',
|
||||
appBasePath: '/test/base/path/app/test',
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -111,7 +111,10 @@ export const legacyAppRegister = (app: App) => {
|
|||
|
||||
// Root controller cannot return a Promise so use an internal async function and call it immediately
|
||||
(async () => {
|
||||
const unmount = await app.mount({ core: npStart.core }, { element, appBasePath: '' });
|
||||
const unmount = await app.mount(
|
||||
{ core: npStart.core },
|
||||
{ element, appBasePath: npSetup.core.http.basePath.prepend(`/app/${app.id}`) }
|
||||
);
|
||||
$scope.$on('$destroy', () => {
|
||||
unmount();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue