Chore: fixing PanelDataTransformationsTab Test (#81329)

* fixing An update to Input inside a test was not wrapped in act(...).

* no need to await twice

* looks like we do need to await twice
This commit is contained in:
Timur Olzhabayev 2024-01-26 09:51:15 +01:00 committed by GitHub
parent 7230ec88a1
commit 802012385d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,8 +102,9 @@ describe('PanelDataTransformationsTab', () => {
selectors.components.TransformTab.newTransform('Add field from calculation')
);
const button = transformationCard.getElementsByTagName('button').item(0);
await userEvent.click(button!);
await act(async () => {
await userEvent.click(button!);
});
expect(onChangeTransformation).toHaveBeenCalledWith([{ id: 'calculateField', options: {} }]);
});
@ -129,9 +130,9 @@ describe('PanelDataTransformationsTab', () => {
selectors.components.TransformTab.newTransform('Add field from calculation')
);
const button = transformationCard.getElementsByTagName('button').item(0);
await userEvent.click(button!);
await act(async () => {
await userEvent.click(button!);
});
expect(onChangeTransformation).toHaveBeenCalledWith([
{ id: 'calculateField', options: {} },
{ id: 'calculateField', options: {} },