@@ -259,30 +259,41 @@ test('GitHub token info panel reflects missing and present token states', async
259259} ) => {
260260 await waitForAppReady ( page , `${ appEntryPath } ?feature-ai=true` )
261261
262- const infoButton = page . locator ( '#github-token-info' )
263- const infoPanel = page . locator ( '#github-token-info-panel' )
264- const missingMessage = page . locator ( '.github-token-info-message--missing-token' )
265- const presentMessage = page . locator ( '.github-token-info-message--has-token' )
262+ const infoButtonMissing = page . getByRole ( 'button' , {
263+ name : 'About GitHub token features and privacy' ,
264+ } )
265+ const infoButtonPresent = page . getByRole ( 'button' , {
266+ name : 'About GitHub token privacy' ,
267+ } )
268+ const missingMessage = page . getByText ( 'Provide a GitHub PAT' , { exact : false } )
269+ const presentMessage = page . getByText (
270+ 'This token is stored only in your browser and is sent only to GitHub APIs you invoke. Use the trash icon to remove it from storage.' ,
271+ )
266272
267- await expect ( infoButton ) . toHaveText ( '?' )
268- await expect ( infoButton ) . toHaveAttribute ( 'data-token-state' , 'missing' )
273+ await expect ( infoButtonMissing ) . toHaveAttribute ( 'data-token-state' , 'missing' )
274+ await expect ( infoButtonMissing ) . toHaveAttribute (
275+ 'aria-label' ,
276+ 'About GitHub token features and privacy' ,
277+ )
278+ await expect ( presentMessage ) . toBeHidden ( )
269279
270- await infoButton . click ( )
271- await expect ( infoPanel ) . toBeVisible ( )
280+ await infoButtonMissing . click ( )
272281 await expect ( missingMessage ) . toBeVisible ( )
273282 await expect ( missingMessage ) . toContainText ( 'Provide a GitHub PAT' )
274- await expect ( missingMessage . getByRole ( 'link' , { name : 'docs' } ) ) . toHaveAttribute (
283+ await expect ( page . getByRole ( 'link' , { name : 'docs' } ) ) . toHaveAttribute (
275284 'href' ,
276285 'https://github.com/knightedcodemonkey/develop/blob/main/docs/byot.md' ,
277286 )
278287 await expect ( presentMessage ) . toBeHidden ( )
279288
280289 await connectByotWithSingleRepo ( page )
281- await expect ( infoButton ) . toHaveText ( 'i' )
282- await expect ( infoButton ) . toHaveAttribute ( 'data-token-state' , 'present' )
290+ await expect ( infoButtonPresent ) . toHaveAttribute ( 'data-token-state' , 'present' )
291+ await expect ( infoButtonPresent ) . toHaveAttribute (
292+ 'aria-label' ,
293+ 'About GitHub token privacy' ,
294+ )
283295
284- await infoButton . click ( )
285- await expect ( infoPanel ) . toBeVisible ( )
296+ await infoButtonPresent . click ( )
286297 await expect ( presentMessage ) . toBeVisible ( )
287298 await expect ( presentMessage ) . toContainText (
288299 'Use the trash icon to remove it from storage.' ,
0 commit comments