Skip to content

Commit

Permalink
Add acts
Browse files Browse the repository at this point in the history
  • Loading branch information
kielbasa-elp committed Feb 21, 2024
1 parent 1f71b77 commit 0272588
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ describe(PipelinesPage.name, () => {

const addButton = blockTypes[0].querySelector("button");

await act(() => userEvent.click(addButton!));
await act(async () => {
await userEvent.click(addButton!);
});

const blocks = await page.getBlocks();

Expand All @@ -94,11 +96,11 @@ describe(PipelinesPage.name, () => {
/Delete block: text_input_1/i
);

await act(() => page.fireBlockOnClick(deleteButton.buttonElement));

const confirmButton = await ButtonHandle.fromRole("Confirm");
act(() => {
page.fireBlockOnClick(deleteButton.buttonElement);
});

await act(() => confirmButton.click());
await page.confirmAction();

const blocks = await page.getBlocks();

Expand All @@ -114,7 +116,9 @@ describe(PipelinesPage.name, () => {
/Edit block: text_output_1/i
);

await act(() => page.fireBlockOnClick(editButton.buttonElement));
act(() => {
page.fireBlockOnClick(editButton.buttonElement);
});

await screen.findByText(/Text Output 1/i);

Expand All @@ -126,7 +130,9 @@ describe(PipelinesPage.name, () => {

const submit = await ButtonHandle.fromRole("Save changes");

await act(async () => await submit.click());
await act(async () => {
await submit.click();
});

await waitFor(() => screen.findByText(/super_output/i));
});
Expand Down

0 comments on commit 0272588

Please sign in to comment.