Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephl3 committed Oct 11, 2024
1 parent f10ec12 commit 4733052
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/combobox/src/Combobox/Combobox.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ describe('packages/combobox', () => {
if (select === 'multiple') {
expect(queryAllChips()).toHaveLength(0);
} else {
expect(inputEl).toHaveValue('');
await waitFor(() => expect(inputEl).toHaveValue(''));
}
});
});
Expand Down
3 changes: 3 additions & 0 deletions packages/menu/src/Menu.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,17 @@ describe('packages/menu', () => {
test('highlights the previous option in the menu', async () => {
const { openMenu } = renderMenu({});
const { menuItemElements } = await openMenu();
await waitFor(() => expect(menuItemElements[0]).toHaveFocus());

userEvent.keyboard('{arrowdown}');
userEvent.keyboard('{arrowup}');
expect(menuItemElements[0]).toHaveFocus();
});

test('cycles highlight to the bottom', async () => {
const { openMenu } = renderMenu({});
const { menuItemElements } = await openMenu();
await waitFor(() => expect(menuItemElements[0]).toHaveFocus());

const lastOption = menuItemElements[menuItemElements.length - 1];
userEvent.keyboard('{arrowup}');
Expand Down
3 changes: 3 additions & 0 deletions packages/split-button/src/SplitButton/SplitButton.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,17 @@ describe('packages/split-button', () => {
test('highlights the previous option in the menu', async () => {
const { openMenu } = renderSplitButton({ menuItems });
const { menuEl, menuItemElements } = await openMenu();
await waitFor(() => expect(menuItemElements[0]).toHaveFocus());

userEvent.type(menuEl!, '{arrowdown}');
userEvent.type(menuEl!, '{arrowup}');
expect(menuItemElements[0]).toHaveFocus();
});

test('cycles highlight to the bottom', async () => {
const { openMenu } = renderSplitButton({ menuItems });
const { menuEl, menuItemElements } = await openMenu();
await waitFor(() => expect(menuItemElements[0]).toHaveFocus());

const lastOption = menuItemElements[menuItemElements.length - 1];
userEvent.type(menuEl!, '{arrowup}');
Expand Down

0 comments on commit 4733052

Please sign in to comment.