Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/Package/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ useShortcuts({
</header>
<div
ref="header"
class="w-full bg-bg sticky top-14 z-50 border-b border-border pt-2"
class="w-full bg-bg sticky top-14 z-40 border-b border-border pt-2"
:class="[$style.packageHeader]"
data-testid="package-subheader"
>
Expand Down
34 changes: 34 additions & 0 deletions test/e2e/interactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,40 @@ test.describe('Package Page', () => {
).toBe(true)
}
})

test('AccountMenu dropdown items are clickable on package pages', async ({ page, goto }) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do something like this since you only need to check the center

test('AccountMenu dropdown items are clickable on package pages', async ({ page, goto }) => {
  await goto('/package/vue', { waitUntil: 'hydration' })

  await page.getByRole('button', { name: /^connect$/i }).click()
  const items = page.getByRole('menuitem')

  for (const item of await items.all()) {
    await item.click({ trial: true })
  }
})

Copy link
Copy Markdown
Author

@ptdewey ptdewey May 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried something like that initially, but this version passes w/o the change. I'm not certain why, but I think it might be because the upper and lower edges of the item can be clicked from behind the banner?

image

await goto('/package/vue', { waitUntil: 'hydration' })

await page.getByRole('button', { name: /^connect$/i }).click()
const items = page.getByRole('menuitem')
await expect(items.first()).toBeVisible()

// Verify each menu item is the topmost element at its own center.
for (const item of await items.all()) {
const box = await item.boundingBox()
if (!box) throw new Error('Menu item has no bounding box')
const cx = box.x + box.width / 2
const cy = box.y + box.height / 2

const hit = await page.evaluate(
({ x, y }) => {
const el = document.elementFromPoint(x, y)
return {
insideMenuitem: el?.closest('[role="menuitem"]') !== null,
occluderTag: el?.tagName,
occluderClass: typeof el?.className === 'string' ? el.className.slice(0, 100) : '',
occluderText: el?.textContent?.trim().slice(0, 60),
}
},
{ x: cx, y: cy },
)

expect(
hit.insideMenuitem,
`Menu item center (${cx.toFixed(0)}, ${cy.toFixed(0)}) is occluded by <${hit.occluderTag} class="${hit.occluderClass}">${hit.occluderText ? ` "${hit.occluderText}"` : ''}`,
).toBe(true)
}
})
})

test.describe('Search Pages', () => {
Expand Down
Loading