await userEvent

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-04-01 10:43:58 +02:00
parent 659111711e
commit b1190bf676
36 changed files with 177 additions and 174 deletions
@@ -61,7 +61,7 @@ describe('SidebarThemeSwitcher', () => {
const button = getByLabelText('Switch Theme');
expect(button).toBeInTheDocument();
userEvent.click(button);
await userEvent.click(button);
expect(getByRole('listbox')).toBeInTheDocument();
expect(getByText('Dark Theme')).toBeInTheDocument();
@@ -80,11 +80,11 @@ describe('SidebarThemeSwitcher', () => {
const button = getByLabelText('Switch Theme');
expect(button).toBeInTheDocument();
userEvent.click(button);
await userEvent.click(button);
expect(getByRole('listbox')).toBeInTheDocument();
userEvent.click(getByText('Light Theme'));
await userEvent.click(getByText('Light Theme'));
expect(appThemeApi.setActiveThemeId).toHaveBeenCalledWith('light');
});