Skip to main content

Function: waitForElementToBeRemoved()

waitForElementToBeRemoved(elementOrCallback, options?): Promise<void>

Defined in: wait-for.ts:84

Waits for an element to be removed from the widget tree.

Polls until the element no longer has a parent or no longer exists.

Parameters

ParameterTypeDescription
elementOrCallbackElementOrCallbackElement or function returning element to watch
options?WaitForOptionsTimeout and interval configuration

Returns

Promise<void>

Example

import { waitForElementToBeRemoved } from "@gtkx/testing";

const loader = await screen.findByRole(Gtk.AccessibleRole.PROGRESS_BAR);
await waitForElementToBeRemoved(loader);
// Loader is now gone