@@ -825,6 +825,12 @@ async function sidebarChecks() {
825825 const restore = await startRename ( )
826826 await restore . fill ( ORGANIZATION_NAME )
827827 await restore . press ( 'Enter' )
828+ await expect
829+ . poll (
830+ async ( ) =>
831+ ( await sql `select name from organization where id = ${ ORGANIZATION_ID } ` ) [ 0 ] ?. name
832+ )
833+ . toBe ( ORGANIZATION_NAME )
828834 await expect ( chip ) . toContainText ( ORGANIZATION_NAME )
829835 } )
830836 }
@@ -2141,17 +2147,49 @@ async function integrationChecks() {
21412147 } )
21422148
21432149 section ( '3 Generic Secrets' )
2144- await check ( 'the Generic Secrets page opens in member mode with a way back' , async ( ) => {
2150+ await check ( 'member mode opens the personal editor and keeps q on the way back' , async ( ) => {
21452151 await withSession ( MEMBER , async ( { page } ) => {
2146- await page . goto ( url ( `${ root } /integrations/secrets?q=sec` ) )
2147- await expect (
2148- page
2149- . getByRole ( 'link' , { name : / I n t e g r a t i o n s / } )
2150- . or ( page . getByRole ( 'button' , { name : / B a c k | I n t e g r a t i o n s / } ) )
2151- . first ( )
2152- ) . toBeVisible ( )
2152+ await page . goto ( url ( `${ root } /integrations?q=secret` ) )
2153+ const row = page
2154+ . getByRole ( 'main' )
2155+ . getByRole ( 'link' )
2156+ . filter ( { hasText : / S e c r e t s / } )
2157+ await expect ( row ) . toContainText ( 'Personal secrets' )
2158+ await row . click ( )
2159+ await expect ( page ) . toHaveURL (
2160+ ( address ) =>
2161+ address . pathname === `${ root } /integrations/secrets` &&
2162+ address . searchParams . get ( 'q' ) === 'secret'
2163+ )
2164+ await page
2165+ . getByRole ( 'link' , { name : / I n t e g r a t i o n s / } )
2166+ . first ( )
2167+ . click ( )
2168+ await expect ( page ) . toHaveURL (
2169+ ( address ) =>
2170+ address . pathname === `${ root } /integrations` && address . searchParams . get ( 'q' ) === 'secret'
2171+ )
21532172 } )
21542173 } )
2174+ await check ( 'organization mode lists a read-only view under the organization' , async ( ) => {
2175+ await sql `update organization_secret_source set mode = 'organization' where organization_id = ${ ORGANIZATION_ID } `
2176+ await withSession ( MEMBER , async ( { page } ) => {
2177+ await page . goto ( url ( `${ root } /integrations?q=secret` ) )
2178+ const row = page
2179+ . getByRole ( 'region' , { name : 'Managed by your organization' } )
2180+ . getByRole ( 'link' )
2181+ . filter ( { hasText : / S e c r e t s / } )
2182+ await expect ( row ) . toContainText ( 'Organization managed' )
2183+ await row . click ( )
2184+ await expect ( page ) . toHaveURL (
2185+ ( address ) => address . pathname === `${ root } /integrations/generic-secrets`
2186+ )
2187+ await expect ( page . getByRole ( 'heading' , { level : 1 } ) ) . toContainText ( 'Secrets' )
2188+ } ) . finally (
2189+ ( ) =>
2190+ sql `update organization_secret_source set mode = 'member' where organization_id = ${ ORGANIZATION_ID } `
2191+ )
2192+ } )
21552193 notProvable (
21562194 'Slack onboarding ?slack= actions' ,
21572195 'A valid token needs a Slack workspace install; invalid tokens are asserted as not found'
0 commit comments