@@ -122,10 +122,12 @@ describe('live member connection states', () => {
122122 it . each ( [
123123 [ 'disabled' , { credentialGroup : { ...group , status : 'disabled' } } ] ,
124124 [ 'unconfigured' , { credentialGroup : null } ] ,
125- ] ) ( 'does not offer a connection when %s' , async ( _name , overrides ) => {
125+ ] ) ( 'disables connection when %s' , async ( _name , overrides ) => {
126126 mocks . inventory . mockReturnValue ( { data : inventory ( overrides ) } )
127127 await render ( )
128- expect ( button ( 'Connect' ) ) . toBeUndefined ( )
128+ expect ( button ( 'Connect' ) ?. disabled ) . toBe ( true )
129+ await act ( async ( ) => button ( 'Connect' ) ! . click ( ) )
130+ expect ( mocks . connect ) . not . toHaveBeenCalled ( )
129131 } )
130132 it ( 'shows the current account and reconnect action without enabling a disabled integration' , async ( ) => {
131133 mocks . inventory . mockReturnValue ( {
@@ -192,13 +194,21 @@ describe('live member connection states', () => {
192194 await render ( )
193195 expect ( container . textContent ) . toBe ( '' )
194196 } )
195- it ( 'sends admins to Credential Groups when member sign-in is not configured' , async ( ) => {
196- mocks . inventory . mockReturnValue ( { data : inventory ( { credentialGroup : null , canManage : true } ) } )
197- await render ( )
198- expect ( container . querySelector ( 'a' ) ?. getAttribute ( 'href' ) ) . toBe (
199- '/o/org/settings/connected-accounts'
200- )
201- } )
197+ it . each ( [ false , true ] ) (
198+ 'keeps Slack app setup out of member Integrations, admin=%s' ,
199+ async ( canManage ) => {
200+ mocks . policies . mockReturnValue ( { data : [ { connectorType : 'slack' , approved : true } ] } )
201+ mocks . inventory . mockReturnValue ( { data : inventory ( { canManage } ) } )
202+ await render ( )
203+ expect ( container . textContent ) . toContain ( 'Slack' )
204+ expect ( container . textContent ) . toContain ( 'Not configured' )
205+ expect ( container . textContent ) . not . toContain ( 'Finish setup' )
206+ expect ( container . querySelector ( 'a' ) ) . toBeNull ( )
207+ expect ( button ( 'Connect' ) ?. disabled ) . toBe ( true )
208+ await act ( async ( ) => button ( 'Connect' ) ! . click ( ) )
209+ expect ( mocks . connect ) . not . toHaveBeenCalled ( )
210+ }
211+ )
202212 it ( 'explains service-account scope without hiding member connection controls' , async ( ) => {
203213 mocks . policies . mockReturnValue ( {
204214 data : [
0 commit comments