@@ -52,7 +52,7 @@ vi.mock('@/ee/credential-groups/components/organization-account-people', () => (
5252 OrganizationAccountPeople : ( ) => null ,
5353} ) )
5454vi . mock ( '@/ee/credential-groups/components/organization-account-workspace-access' , ( ) => ( {
55- OrganizationAccountWorkspaceAccess : ( ) => null ,
55+ OrganizationAccountWorkspaceAccess : ( ) => < div data-testid = 'workspace-access' > Workspaces </ div > ,
5656} ) )
5757
5858import { OrganizationAccountProviders } from '@/ee/credential-groups/components/organization-account-providers'
@@ -167,6 +167,33 @@ describe('organization provider configuration UI', () => {
167167 } )
168168 }
169169
170+ it ( 'keeps workspace allowlists in the Access tab and preserves the integration controls' , async ( ) => {
171+ mocks . accounts . mockReturnValue ( {
172+ data : {
173+ canManage : true ,
174+ credentialGroup : { ...group , options : [ gmail ] } ,
175+ availableProviders : [ 'gmail' ] ,
176+ } ,
177+ } )
178+ await act ( async ( ) =>
179+ root . render (
180+ < NuqsTestingAdapter hasMemory >
181+ < OrganizationConnectedAccounts organizationId = 'org-1' />
182+ </ NuqsTestingAdapter >
183+ )
184+ )
185+ expect ( container . textContent ) . toContain ( 'Update configurations' )
186+ expect ( container . querySelector ( '[data-testid="workspace-access"]' ) ) . toBeNull ( )
187+ await clickButton ( 'Access' )
188+ expect ( container . querySelector ( '[data-testid="workspace-access"]' ) ) . not . toBeNull ( )
189+ expect ( container . textContent ) . not . toContain ( 'Update configurations' )
190+ expect ( container . querySelector ( '[role="combobox"]' ) ) . toBeNull ( )
191+ await clickButton ( 'Integrations' )
192+ expect ( container . textContent ) . toContain ( 'Update configurations' )
193+ expect ( container . querySelector ( '[data-testid="workspace-access"]' ) ) . toBeNull ( )
194+ expect ( mocks . update ) . not . toHaveBeenCalled ( )
195+ } )
196+
170197 it ( 'shows only added providers and searches the remaining catalog' , async ( ) => {
171198 await render ( [ ] , [ gmail ] )
172199 expect ( container . textContent ) . toContain ( 'Gmail' )
@@ -175,7 +202,7 @@ describe('organization provider configuration UI', () => {
175202 expect ( container . textContent ) . not . toMatch ( / R e a d y | S e t u p r e q u i r e d / )
176203 expect ( container . textContent ) . not . toContain ( 'Fireflies' )
177204 expect ( container . querySelector ( '[role="radio"]' ) ) . toBeNull ( )
178- await clickButton ( 'Add provider ' )
205+ await clickButton ( 'Add integration ' )
179206 expect ( document . querySelector ( '[aria-label="Add Gmail"]' ) ) . toBeNull ( )
180207 const search = document . querySelector ( '[aria-label="Search providers"]' )
181208 await act ( async ( ) => {
@@ -191,7 +218,7 @@ describe('organization provider configuration UI', () => {
191218
192219 it ( 'adds Fireflies directly without an empty configuration modal' , async ( ) => {
193220 await render ( [ ] )
194- await clickButton ( 'Add provider ' )
221+ await clickButton ( 'Add integration ' )
195222 await clickButton ( 'Add Fireflies' )
196223 expect ( mocks . add ) . toHaveBeenCalledWith (
197224 { organizationId : 'org-1' , connectorId : 'fireflies' } ,
@@ -208,7 +235,7 @@ describe('organization provider configuration UI', () => {
208235
209236 it ( 'adds Gmail directly without opening indexing configuration' , async ( ) => {
210237 await render ( [ ] )
211- await clickButton ( 'Add provider ' )
238+ await clickButton ( 'Add integration ' )
212239 await clickButton ( 'Add Gmail' )
213240 expect ( mocks . update ) . toHaveBeenCalledWith (
214241 {
@@ -341,7 +368,7 @@ describe('organization provider configuration UI', () => {
341368 it ( 'surfaces an add failure in the catalog and does not open configuration' , async ( ) => {
342369 mocks . add . mockImplementation ( ( ) => { } )
343370 await render ( [ ] )
344- await clickButton ( 'Add provider ' )
371+ await clickButton ( 'Add integration ' )
345372 await clickButton ( 'Add Fireflies' )
346373 mocks . addError = new Error ( 'Could not add Fireflies' )
347374 await render ( [ ] )
@@ -373,7 +400,7 @@ describe('organization provider configuration UI', () => {
373400 it ( 'returns an unfinished Databricks entry to the catalog until its configuration is saved' , async ( ) => {
374401 await render ( [ provider ] )
375402 expect ( container . textContent ) . not . toContain ( 'Databricks' )
376- await clickButton ( 'Add provider ' )
403+ await clickButton ( 'Add integration ' )
377404 await clickButton ( 'Add Databricks' )
378405 expect ( mocks . add ) . not . toHaveBeenCalled ( )
379406 expect ( mocks . addAsync ) . not . toHaveBeenCalled ( )
@@ -393,7 +420,7 @@ describe('organization provider configuration UI', () => {
393420
394421 it ( 'cancels Databricks setup without adding a provider' , async ( ) => {
395422 await render ( [ ] )
396- await clickButton ( 'Add provider ' )
423+ await clickButton ( 'Add integration ' )
397424 await clickButton ( 'Add Databricks' )
398425 expect ( mocks . setup ) . toHaveBeenCalledWith ( 'org-1' , false )
399426 expect ( document . querySelector ( '[role="dialog"]' ) ?. textContent ) . toContain ( 'Add Databricks' )
@@ -413,7 +440,7 @@ describe('organization provider configuration UI', () => {
413440
414441 it ( 'adds Databricks with its complete configuration in one organization-scoped request' , async ( ) => {
415442 await render ( [ ] )
416- await clickButton ( 'Add provider ' )
443+ await clickButton ( 'Add integration ' )
417444 await clickButton ( 'Add Databricks' )
418445 expect ( mocks . addAsync ) . not . toHaveBeenCalled ( )
419446 await fill ( 'Name' , ' Analytics ' )
@@ -437,7 +464,7 @@ describe('organization provider configuration UI', () => {
437464 it ( 'keeps Databricks configuration open after validation fails and allows correction' , async ( ) => {
438465 mocks . addAsync . mockRejectedValueOnce ( new Error ( 'Enter a valid Databricks MCP URL' ) )
439466 await render ( [ ] )
440- await clickButton ( 'Add provider ' )
467+ await clickButton ( 'Add integration ' )
441468 await clickButton ( 'Add Databricks' )
442469 await fill ( 'MCP URL' , 'https://invalid.example.com/mcp' )
443470 await fill ( 'OAuth Client ID' , 'client-1' )
0 commit comments