Skip to content

Commit

Permalink
(single-focus-trap) Fix failure of headless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DaviDevMod committed Nov 13, 2022
1 parent 30f851e commit 6c93f7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/e2e-single-focus-trap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v4
with:
browser: chrome
headed: true
install: false
working-directory: packages/single-focus-trap
start: yarn workspace demo dev
Expand Down
5 changes: 4 additions & 1 deletion apps/demo/components/UI/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export function Menu({ label, items }: MenuProps) {
leaveFrom="transform opacity-100 scale-100"
leaveTo="transform opacity-0 scale-95"
>
<HeadlessUIMenu.Items className="absolute z-10 mt-2 w-full origin-top-left divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<HeadlessUIMenu.Items
className="absolute z-10 mt-2 w-full origin-top-left divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"
data-cy={`${label} Menu Items`}
>
{items}
</HeadlessUIMenu.Items>
</Transition>
Expand Down
2 changes: 2 additions & 0 deletions packages/single-focus-trap/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Cypress.Commands.add('buildTrap', ({ roots, initialFocus, returnFocus, lock, esc
optionButtonName: 'Select BUILD Action',
});

cy.get('@trapControls').find('button[data-cy="Action Menu Items"]').should('not.exist');

cy.get('@trapControls').openDropdownAndChoose('Toggle roots Listbox', {
itemsText: roots,
});
Expand Down

2 comments on commit 6c93f7c

@vercel
Copy link

@vercel vercel bot commented on 6c93f7c Nov 13, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

focus-trap-demo-q37s – ./apps/demo

focus-trap-demo-q37s-davidevmod.vercel.app
focus-trap-demo-q37s.vercel.app
focus-trap-demo-q37s-git-main-davidevmod.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 6c93f7c Nov 13, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

focus-trap-demo – ./apps/demo

focus-trap-demo-git-main-davidevmod.vercel.app
focus-trap-demo-davidevmod.vercel.app
focus-trap-demo.vercel.app

Please sign in to comment.