@@ -27,7 +27,7 @@ import { createRenderer, createAppMounter, createLegacyAppMounter, getUnmounter
2727import { AppStatus } from '../types' ;
2828import { ScopedHistory } from '../scoped_history' ;
2929
30- describe ( 'AppContainer ' , ( ) => {
30+ describe ( 'AppRouter ' , ( ) => {
3131 let mounters : MockedMounterMap < EitherApp > ;
3232 let globalHistory : History ;
3333 let appStatuses$ : BehaviorSubject < Map < string , AppStatus > > ;
@@ -78,6 +78,16 @@ describe('AppContainer', () => {
7878 history . push ( '/subpath' ) ;
7979 } ,
8080 } ) ,
81+ createAppMounter ( {
82+ appId : 'app5' ,
83+ html : '<div>App 5</div>' ,
84+ appRoute : '/app/my-app/app5' ,
85+ } ) ,
86+ createAppMounter ( {
87+ appId : 'app6' ,
88+ html : '<div>App 6</div>' ,
89+ appRoute : '/app/my-app/app6' ,
90+ } ) ,
8191 ] as Array < MockedMounterTuple < EitherApp > > ) ;
8292 globalHistory = createMemoryHistory ( ) ;
8393 appStatuses$ = mountersToAppStatus$ ( ) ;
@@ -282,6 +292,16 @@ describe('AppContainer', () => {
282292 expect ( unmount ) . not . toHaveBeenCalled ( ) ;
283293 } ) ;
284294
295+ it ( 'allows multiple apps with the same `/app/appXXX` appRoute prefix' , async ( ) => {
296+ await navigate ( '/app/my-app/app5/path' ) ;
297+ expect ( mounters . get ( 'app5' ) ! . mounter . mount ) . toHaveBeenCalledTimes ( 1 ) ;
298+ expect ( mounters . get ( 'app6' ) ! . mounter . mount ) . toHaveBeenCalledTimes ( 0 ) ;
299+
300+ await navigate ( '/app/my-app/app6/another-path' ) ;
301+ expect ( mounters . get ( 'app5' ) ! . mounter . mount ) . toHaveBeenCalledTimes ( 1 ) ;
302+ expect ( mounters . get ( 'app6' ) ! . mounter . mount ) . toHaveBeenCalledTimes ( 1 ) ;
303+ } ) ;
304+
285305 it ( 'should not remount when when changing pages within app using hash history' , async ( ) => {
286306 globalHistory = createHashHistory ( ) ;
287307 update = createRenderer (
0 commit comments