@@ -1026,9 +1026,11 @@ describe('Search source setup with real connector dialogs', () => {
10261026 )
10271027 } )
10281028
1029- it ( 'opens GitLab with its single central method and submits the custom host and PAT' , async ( ) => {
1029+ it ( 'opens GitLab token tabs and submits the custom host and PAT with managed access ' , async ( ) => {
10301030 await render ( setup ( ) , '?addConnector=gitlab' )
1031- expect ( document . body . textContent ) . toContain ( 'Admin or service account' )
1031+ expect ( button ( 'Administrator token' ) ) . toHaveAttribute ( 'aria-checked' , 'true' )
1032+ expect ( button ( 'Non-admin token' ) ) . toHaveAttribute ( 'aria-checked' , 'false' )
1033+ expect ( document . body . textContent ) . not . toContain ( 'Connection method' )
10321034 expect ( document . body . textContent ) . not . toContain ( 'Member accounts' )
10331035 expect ( button ( 'Connect & Sync' ) ) . toBeDisabled ( )
10341036 await fill ( 'Enter your GitLab PAT' , 'test-pat' )
@@ -1197,14 +1199,16 @@ describe('member content credentials in real add and edit dialogs', () => {
11971199 )
11981200 await click ( card ! )
11991201 expect ( document . body . textContent ) . not . toContain ( 'Connected members' )
1200- expect ( button ( 'Workspace' ) ) . toHaveAttribute ( 'aria-checked' , 'true' )
1202+ expect ( button ( 'Administrator token' ) ) . toHaveAttribute ( 'aria-checked' , 'true' )
1203+ expect ( document . body . textContent ) . not . toContain ( 'Connection method' )
12011204 await fill ( 'Enter your GitLab PAT' , 'new-pat' )
1205+ await fill ( 'gitlab.example.com' , 'gitlab.example.test' )
12021206 await fill ( 'group/project or numeric ID' , '1' )
12031207 expect ( button ( 'Connect & Sync' ) ) . toBeEnabled ( )
12041208 await click ( button ( 'Connect & Sync' ) )
12051209 expect ( mocks . create . mock . calls [ 1 ] [ 0 ] ) . toMatchObject ( {
12061210 connectorType : 'gitlab' ,
1207- accessMode : 'workspace ' ,
1211+ accessMode : 'admin ' ,
12081212 apiKey : 'new-pat' ,
12091213 } )
12101214 expect ( mocks . create . mock . calls [ 1 ] [ 0 ] . sourceConfig ) . not . toHaveProperty ( 'excludeChannels' )
@@ -1978,8 +1982,9 @@ describe('canonical Search connector safety', () => {
19781982 )
19791983 expect ( gitlab ) . toBeDefined ( )
19801984 await click ( gitlab ! )
1981- expect ( document . body . textContent ) . toContain ( 'Admin or service account' )
1982- expect ( document . querySelector ( '[role="radio"][aria-checked="true"]' ) ) . toBeNull ( )
1985+ expect ( button ( 'Administrator token' ) ) . toHaveAttribute ( 'aria-checked' , 'true' )
1986+ expect ( button ( 'Non-admin token' ) ) . toHaveAttribute ( 'aria-checked' , 'false' )
1987+ expect ( document . body . textContent ) . not . toContain ( 'Connection method' )
19831988 expect (
19841989 Array . from ( document . querySelectorAll ( 'button' ) ) . some (
19851990 ( node ) => node . textContent === 'Workspace'
@@ -2027,8 +2032,9 @@ describe('resuming Search source setup', () => {
20272032
20282033 it ( 'reopens the source from the URL even when the source filter hides its row' , async ( ) => {
20292034 await render ( setup ( ) , '?search=nothing-matches&addConnector=gitlab&credentialDraftId=draft-1' )
2030- expect ( document . body . textContent ) . toContain ( 'Admin or service account' )
2031- expect ( document . querySelector ( '[role="radio"][aria-checked="true"]' ) ) . toBeNull ( )
2035+ expect ( button ( 'Administrator token' ) ) . toHaveAttribute ( 'aria-checked' , 'true' )
2036+ expect ( button ( 'Non-admin token' ) ) . toHaveAttribute ( 'aria-checked' , 'false' )
2037+ expect ( document . body . textContent ) . not . toContain ( 'Connection method' )
20322038 expect ( document . body . textContent ) . toContain ( 'Add GitLab project' )
20332039 expect ( document . body . textContent ) . not . toContain ( 'Sync Frequency' )
20342040 expect ( document . body . textContent ) . not . toContain ( 'Sync automatically' )
0 commit comments