mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Removes console outputs from Cascader.test.tsx (#45142)
This commit is contained in:
parent
f9bb0832ce
commit
e806011a77
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Cascader, CascaderOption, CascaderProps } from './Cascader';
|
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';
|
import userEvent from '@testing-library/user-event';
|
||||||
|
|
||||||
const options = [
|
const options = [
|
||||||
@ -52,16 +52,18 @@ describe('Cascader', () => {
|
|||||||
it('displays updated options', () => {
|
it('displays updated options', () => {
|
||||||
render(<CascaderWithOptionsStateUpdate placeholder={placeholder} onSelect={jest.fn()} />);
|
render(<CascaderWithOptionsStateUpdate placeholder={placeholder} onSelect={jest.fn()} />);
|
||||||
|
|
||||||
|
act(() => {
|
||||||
userEvent.click(screen.getByPlaceholderText(placeholder));
|
userEvent.click(screen.getByPlaceholderText(placeholder));
|
||||||
|
});
|
||||||
|
|
||||||
expect(screen.getByText('Initial state option')).toBeInTheDocument();
|
expect(screen.getByText('Initial state option')).toBeInTheDocument();
|
||||||
expect(screen.queryByText('First')).not.toBeInTheDocument();
|
expect(screen.queryByText('First')).not.toBeInTheDocument();
|
||||||
|
|
||||||
act(() => {
|
act(() => {
|
||||||
jest.runAllTimers();
|
jest.runAllTimers();
|
||||||
|
userEvent.click(screen.getByPlaceholderText(placeholder));
|
||||||
});
|
});
|
||||||
|
|
||||||
userEvent.click(screen.getByPlaceholderText(placeholder));
|
|
||||||
expect(screen.queryByText('Initial state option')).not.toBeInTheDocument();
|
expect(screen.queryByText('Initial state option')).not.toBeInTheDocument();
|
||||||
expect(screen.getByText('First')).toBeInTheDocument();
|
expect(screen.getByText('First')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user