@@ -40,6 +40,8 @@ import {
4040 menuEntry ,
4141 navigateWithinDocument ,
4242 navLabels ,
43+ openMenu ,
44+ openOrgCard ,
4345 openRowMenu ,
4446 orgCard ,
4547 orgChip ,
@@ -335,8 +337,7 @@ export async function sidebarChecks() {
335337 await onHome ( MEMBER , async ( { page } ) => {
336338 const chip = orgChip ( page )
337339 await expect ( chip ) . toContainText ( ORGANIZATION_NAME )
338- await chip . click ( )
339- const card = orgCard ( page )
340+ const card = await openOrgCard ( page )
340341 await expect ( card . getByText ( / \d + m e m b e r s ? / ) ) . toBeVisible ( )
341342 await expect ( card . getByRole ( 'button' , { name : 'Rename organization' } ) ) . toHaveCount ( 0 )
342343 await expect ( card . getByRole ( 'button' , { name : 'Change organization logo' } ) ) . toHaveCount ( 0 )
@@ -358,7 +359,7 @@ export async function sidebarChecks() {
358359 return card . getByRole ( 'textbox' , { name : 'Organization name' } )
359360 }
360361 const renamed = `${ ORGANIZATION_NAME } Group`
361- await chip . click ( )
362+ await openOrgCard ( page )
362363 const field = await startRename ( )
363364 await field . fill ( 'Discarded name' )
364365 await field . press ( 'Escape' )
@@ -369,7 +370,7 @@ export async function sidebarChecks() {
369370 await expect ( chip ) . toContainText ( renamed )
370371 await page . reload ( )
371372 await expect ( chip ) . toContainText ( renamed )
372- await chip . click ( )
373+ await openOrgCard ( page )
373374 const restore = await startRename ( )
374375 await restore . fill ( ORGANIZATION_NAME )
375376 await restore . press ( 'Enter' )
@@ -393,7 +394,7 @@ export async function sidebarChecks() {
393394 : route . continue ( )
394395 )
395396 await page . goto ( orgUrl ( '/home' ) )
396- await orgChip ( page ) . click ( )
397+ await openOrgCard ( page )
397398 const card = orgCard ( page )
398399 await card . getByRole ( 'button' , { name : 'Rename organization' } ) . click ( )
399400 const field = card . getByRole ( 'textbox' , { name : 'Organization name' } )
@@ -410,7 +411,7 @@ export async function sidebarChecks() {
410411 ( ) => sql `update organization set logo = null where id = ${ ORGANIZATION_ID } ` ,
411412 ( ) =>
412413 onHome ( ADMIN , async ( { page } ) => {
413- await orgChip ( page ) . click ( )
414+ await openOrgCard ( page )
414415 const card = orgCard ( page )
415416 await expect ( card . getByRole ( 'button' , { name : 'Change organization logo' } ) ) . toBeEnabled ( )
416417 const started = page . waitForResponse (
@@ -442,13 +443,13 @@ export async function sidebarChecks() {
442443 )
443444 await check ( 'Invite follows the default group, and an admin invites when it allows' , async ( ) => {
444445 await onHome ( ADMIN , async ( { page } ) => {
445- await orgChip ( page ) . click ( )
446+ await openOrgCard ( page )
446447 await expect ( orgCard ( page ) . getByRole ( 'button' , { name : 'Invite' , exact : true } ) ) . toHaveCount (
447448 0
448449 )
449450 await sql `update permission_group set config = config - 'disableInvitations' where id = ${ STANDARD_GROUP_ID } `
450451 await page . reload ( )
451- await orgChip ( page ) . click ( )
452+ await openOrgCard ( page )
452453 await orgCard ( page ) . getByRole ( 'button' , { name : 'Invite' , exact : true } ) . click ( )
453454 const modal = dialog ( page , 'Invite people' )
454455 await expect ( modal ) . toBeVisible ( )
@@ -729,8 +730,7 @@ export async function sidebarChecks() {
729730 const chip = accountChip ( page )
730731 await expect ( chip ) . toContainText ( MEMBER . name )
731732 await expect ( chip ) . toHaveAccessibleName ( `${ MEMBER . name } , account menu` )
732- await chip . click ( )
733- const menu = dialog ( page , 'Account menu' )
733+ const menu = await openMenu ( chip , dialog ( page , 'Account menu' ) )
734734 await expect ( menu . getByRole ( 'button' , { name : 'Sign out' , exact : true } ) ) . toBeVisible ( )
735735 await menu . getByRole ( 'button' , { name : 'Settings' , exact : true } ) . click ( )
736736 await expect ( page ) . toHaveURL ( orgUrl ( '/settings/general' ) )
0 commit comments