{ const canvas = within(canvasElement); await userEvent.click(canvas.getByRole("button", { name: /publish as alice/i })); await userEvent.click(await canvas.findByRole("menuitem", { name: /bob/i })); await waitFor(() => expect(canvas.getByRole("button", { name: /publish as bob/i })).toBeVisible() ); }} > {#snippet template(args)} {/snippet} { const canvas = within(canvasElement); expect(canvas.queryByRole("button", { name: /publish as/i })).toBeNull(); await waitFor(() => expect(canvas.getByRole("button", { name: "Save changes" })).toBeVisible() ); }} > {#snippet template(args)} {/snippet}