{ const canvas = within(canvasElement); await userEvent.click(canvas.getByRole("button", { name: "Save" })); await waitFor(() => expect(canvas.getByRole("alert")).toHaveTextContent(/network request failed/i) ); }} /> { const canvas = within(canvasElement); await userEvent.click(canvas.getByRole("button", { name: /comment as alice/i })); await userEvent.click(await canvas.findByRole("menuitem", { name: /bob/i })); await waitFor(() => expect(canvas.getByRole("button", { name: /comment as bob/i })).toBeVisible() ); }} /> { const canvas = within(canvasElement); expect(canvas.queryByRole("button", { name: /comment as/i })).toBeNull(); await waitFor(() => expect(canvas.getByRole("button", { name: "Save" })).toBeVisible()); }} /> { const canvas = within(canvasElement); await userEvent.click(canvas.getByRole("button", { name: /comment as alice/i })); await userEvent.click(await canvas.findByRole("menuitem", { name: /bob/i })); await userEvent.type(canvas.getByPlaceholderText(/add to the discussion/i), "as bob"); await userEvent.click(canvas.getByRole("button", { name: "Comment" })); await waitFor(() => expect(canvas.getByRole("alert")).toHaveTextContent(/session expired/i) ); await waitFor(() => expect(canvas.getByRole("button", { name: /comment as alice/i })).toBeVisible() ); await userEvent.click(canvas.getByRole("button", { name: /comment as alice/i })); await waitFor(() => expect(canvas.getByRole("menuitem", { name: /carol/i })).toBeVisible()); expect(canvas.queryByRole("menuitem", { name: /bob/i })).toBeNull(); }} />