mirror of
https://github.com/grafana/grafana.git
synced 2025-01-06 22:23:19 -06:00
909d0f4ced
* Update Monthly patch updates * update typescript sdk, add ignore for emotion css prop * fix unit tests * type fixes Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
13 lines
584 B
TypeScript
13 lines
584 B
TypeScript
import { waitFor } from '@testing-library/react';
|
|
import { select } from 'react-select-event';
|
|
|
|
// Used to select an option or options from a Select in unit tests
|
|
export const selectOptionInTest = async (
|
|
input: HTMLElement,
|
|
optionOrOptions: string | RegExp | Array<string | RegExp>
|
|
) => await waitFor(() => select(input, optionOrOptions, { container: document.body }));
|
|
|
|
// Finds the parent of the Select so you can assert if it has a value
|
|
export const getSelectParent = (input: HTMLElement) =>
|
|
input.parentElement?.parentElement?.parentElement?.parentElement?.parentElement;
|