mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 03:13:49 +08:00
Upgrade @testing-library/user-event
to v14 (#47898)
* Update dependency @testing-library/user-event to v14 * everything is async... * everything is async pt.2 * Fix cascader tests * hack the yarn.lock file to remove the old version of @testing-library/dom * some more fixes! * MOAR FIXES * more fixes * remove a bunch of places where we're wrapping in act() * down to 7 failing tests... * Fix arrow tests * Fix rest of NavBarItem tests * Fix last tests * Use {Enter} instead of {enter} * Revert "Use {Enter} instead of {enter}" This reverts commit e72453bb522245cbc2acd0736929fbb351ad070a. * remove some unused act imports * Fix LibraryPanelsSearch tests * more stable test * More consistent test... Co-authored-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
@ -53,7 +53,7 @@ describe('OrgSwitcher', () => {
|
||||
it('should switch orgId in call to backend', async () => {
|
||||
const row = screen.getByRole('row', { name: /org 2 admin switch to/i });
|
||||
const switchToButton = within(row).getByText(/switch to/i);
|
||||
userEvent.click(switchToButton);
|
||||
await userEvent.click(switchToButton);
|
||||
|
||||
await waitFor(() => expect(setUserOrgSpy).toBeCalledWith({ orgId: 2, name: 'Org 2', role: 'Admin' }));
|
||||
});
|
||||
@ -63,7 +63,7 @@ describe('OrgSwitcher', () => {
|
||||
|
||||
const row = screen.getByRole('row', { name: /org 2 admin switch to/i });
|
||||
const switchToButton = within(row).getByText(/switch to/i);
|
||||
userEvent.click(switchToButton);
|
||||
await userEvent.click(switchToButton);
|
||||
|
||||
await waitFor(() => expect(window.location.href).toEqual('/subUrl/?orgId=2'));
|
||||
});
|
||||
|
Reference in New Issue
Block a user