Skip to content

Commit

Permalink
chore: fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
HelenaIsh committed Apr 24, 2024
1 parent 69383ee commit 43d2a02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/react-ui/components/Kebab/__tests__/Kebab-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ describe('Kebab', () => {
expect(kebab).not.toHaveFocus();
});

it('should close by pressing escape', () => {
it('should close by pressing escape', async () => {
const content = 'Kebab content';
render(<Kebab>{content}</Kebab>);

userEvent.tab();
userEvent.keyboard('{Enter}');
await userEvent.tab();
await userEvent.keyboard('{Enter}');
expect(screen.getByText(content)).toBeInTheDocument();

userEvent.keyboard('{Escape}');
await userEvent.keyboard('{Escape}');

const kebab = screen.getByTestId(KebabDataTids.caption);
expect(kebab).toHaveFocus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ describe('Props Forwarding', () => {
case 'Toast':
act(() => {
(wrapper as ReactWrapper<unknown, unknown, ReactUI.Toast>).instance().push('Toast');
});
wrapper.update();
return wrapper.find('ToastView').getDOMNode();
case 'SingleToast':
(wrapper.instance().constructor as typeof ReactUI.SingleToast).push('Toast');
act(() => {
(wrapper.instance().constructor as typeof ReactUI.SingleToast).push('Toast');
});
wrapper.update();
return wrapper.find('ToastView').getDOMNode();
Expand Down

0 comments on commit 43d2a02

Please sign in to comment.