From e806011a773f013c1375bb2499f8b641fac781ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Wed, 9 Feb 2022 14:40:28 +0100 Subject: [PATCH] Chore: Removes console outputs from Cascader.test.tsx (#45142) --- .../grafana-ui/src/components/Cascader/Cascader.test.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/Cascader/Cascader.test.tsx b/packages/grafana-ui/src/components/Cascader/Cascader.test.tsx index 702a98a0509..048756a565f 100644 --- a/packages/grafana-ui/src/components/Cascader/Cascader.test.tsx +++ b/packages/grafana-ui/src/components/Cascader/Cascader.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Cascader, CascaderOption, CascaderProps } from './Cascader'; -import { render, screen, act } from '@testing-library/react'; +import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; const options = [ @@ -52,16 +52,18 @@ describe('Cascader', () => { it('displays updated options', () => { render(); - userEvent.click(screen.getByPlaceholderText(placeholder)); + act(() => { + userEvent.click(screen.getByPlaceholderText(placeholder)); + }); expect(screen.getByText('Initial state option')).toBeInTheDocument(); expect(screen.queryByText('First')).not.toBeInTheDocument(); act(() => { jest.runAllTimers(); + userEvent.click(screen.getByPlaceholderText(placeholder)); }); - userEvent.click(screen.getByPlaceholderText(placeholder)); expect(screen.queryByText('Initial state option')).not.toBeInTheDocument(); expect(screen.getByText('First')).toBeInTheDocument(); });