Chore: adjust more unit tests to work with react 18 (#64759)

adjust unit tests to work with react 18
This commit is contained in:
Ashley Harrison
2023-03-15 10:12:13 +00:00
committed by GitHub
parent b6f77bdfdb
commit e0e6165f70
19 changed files with 256 additions and 265 deletions

View File

@@ -548,7 +548,7 @@ describe('Table', () => {
});
describe('when mounted with data and sub-data', () => {
it('then correct rows should be rendered and new table is rendered when expander is clicked', () => {
it('then correct rows should be rendered and new table is rendered when expander is clicked', async () => {
getTestContext({
subData: new Array(getDefaultDataFrame().length).fill(0).map((i) =>
toDataFrame({
@@ -588,7 +588,7 @@ describe('Table', () => {
{ time: '2021-01-01 02:00:00', temperature: '12', link: '12' },
]);
within(rows[1]).getByLabelText('Expand row').click();
await userEvent.click(within(rows[1]).getByLabelText('Expand row'));
const rowsAfterClick = within(getTable()).getAllByRole('row');
expect(within(rowsAfterClick[1]).getByRole('table')).toBeInTheDocument();
expect(within(rowsAfterClick[1]).getByText(/number0/)).toBeInTheDocument();