@@ -430,21 +430,32 @@ async function landingChecks() {
430430 ) . toBeVisible ( )
431431 } )
432432 } )
433- await check ( 'an agent chat redirects a member to Search and renders for an admin' , async ( ) => {
434- await withSession ( MEMBER , async ( { page } ) => {
435- await page . goto ( url ( `${ root } /chat/${ MEMBER_CHATS . agent . id } ` ) )
436- await expect ( page ) . toHaveURL ( ( address ) => address . pathname === `${ root } /search` )
437- await page . goto ( url ( `${ root } /search/chat/${ MEMBER_CHATS . agent . id } ` ) )
438- await expect ( page ) . toHaveURL ( ( address ) => address . pathname === `${ root } /search` )
439- } )
440- await withSession ( ADMIN , async ( { page } ) => {
441- await page . goto ( url ( `${ root } /search/chat/${ ADMIN_CHATS . agent . id } ` ) )
442- await expect ( page ) . toHaveURL ( url ( `${ root } /chat/${ ADMIN_CHATS . agent . id } ` ) )
443- await expect (
444- page . getByText ( `Here is what I found about ${ ADMIN_CHATS . agent . title } .` )
445- ) . toBeVisible ( )
446- } )
447- } )
433+ await check (
434+ 'an agent chat is not found for a member, stays out of their rail, and renders for an admin' ,
435+ async ( ) => {
436+ await withSession ( MEMBER , async ( { page } ) => {
437+ await page . goto ( url ( `${ root } /chat/${ MEMBER_CHATS . agent . id } ` ) )
438+ await expectPageNotFound ( page )
439+ await page . goto ( url ( `${ root } /search/chat/${ MEMBER_CHATS . agent . id } ` ) )
440+ await expectPageNotFound ( page )
441+ await page . goto ( url ( `${ root } /home` ) )
442+ await expect (
443+ sidebar ( page ) . getByRole ( 'link' , { name : MEMBER_CHATS . unread . title } )
444+ ) . toBeVisible ( )
445+ await expect (
446+ sidebar ( page ) . getByRole ( 'link' , { name : MEMBER_CHATS . agent . title } )
447+ ) . toHaveCount ( 0 )
448+ } )
449+ await withSession ( ADMIN , async ( { page } ) => {
450+ await page . goto ( url ( `${ root } /search/chat/${ ADMIN_CHATS . agent . id } ` ) )
451+ await expect ( page ) . toHaveURL ( url ( `${ root } /chat/${ ADMIN_CHATS . agent . id } ` ) )
452+ await expect (
453+ page . getByText ( `Here is what I found about ${ ADMIN_CHATS . agent . title } .` )
454+ ) . toBeVisible ( )
455+ } )
456+ } ,
457+ { allow : [ / 4 0 4 / ] }
458+ )
448459 await check (
449460 'a chat that is not theirs, or in another organization, is not found' ,
450461 async ( ) => {
0 commit comments