@@ -17,6 +17,7 @@ import {
1717} from '../../../__tests__/feature/fapi' ;
1818import { openMenu } from '../../../__tests__/feature/menu' ;
1919import { renderWithClerk } from '../../../__tests__/feature/render' ;
20+ import { useVirtualEntries } from '../../../routing/virtual-store' ;
2021import { OrganizationProfile } from '../../organization-profile/organization-profile' ;
2122import { OrganizationSwitcher } from '../../organization-switcher/organization-switcher' ;
2223import type { MosaicProfile } from '../../profile-pages/use-mosaic-profile' ;
@@ -324,7 +325,24 @@ describe('a mounted OrganizationProfile under a provider profile', () => {
324325 } ) ;
325326} ) ;
326327
328+ function Entry ( { base } : { base : string } ) {
329+ return < output data-testid = 'entry' > { JSON . stringify ( useVirtualEntries ( ) . get ( base ) ?? null ) } </ output > ;
330+ }
331+
327332describe ( 'a mounted UserProfile under a provider profile' , ( ) => {
333+ it ( "routes its pages under the provider's path" , async ( ) => {
334+ await renderWithProfile (
335+ < >
336+ < UserProfile />
337+ < Entry base = '/account' />
338+ </ > ,
339+ { userProfileProps : { path : '/account' } } ,
340+ ) ;
341+
342+ await userEvent . setup ( ) . click ( await screen . findByRole ( 'tab' , { name : 'Security' } ) ) ;
343+ expect ( JSON . parse ( screen . getByTestId ( 'entry' ) . textContent ?? 'null' ) ) . toEqual ( [ 'security' ] ) ;
344+ } ) ;
345+
328346 it ( 'fills in what its own organizationProfileProps leave out from the provider' , async ( ) => {
329347 await renderWithProfile ( < UserProfile organizationProfileProps = { { pageOrder : [ 'members' ] } } /> , {
330348 organizationProfileProps : { customPages : [ { ...terms , label : 'Audit' , path : 'audit' } ] , pageOrder : [ 'general' ] } ,
0 commit comments