How to use the @testing-library/dom.wait function in @testing-library/dom

To help you get started, we’ve selected a few @testing-library/dom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GoogleChrome / lighthouse-ci / test / test-utils.js View on Github external
function waitForCondition(fn, label) {
  return testingLibrary.wait(() => {
    if (!fn()) throw new Error(label || 'Condition not met');
  });
}
github goblindegook / littlefoot / test / helper.ts View on Github external
export async function waitForChange(button: Element): Promise {
  await wait(() => expect(button).not.toHaveClass('is-changing'))
}
github testing-library / vue-testing-library / src / vue-testing-library.js View on Github external
async function fireEvent(...args) {
  dtlFireEvent(...args)
  await wait()
}