How to use the react-testing-library.waitForElement function in react-testing-library

To help you get started, we’ve selected a few react-testing-library 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 flow-typed / flow-typed / definitions / npm / react-testing-library_v5.x.x / flow_v0.67.1- / test_react-testing-library_v5.x.x.js View on Github external
it('should fail on invalid inputs', () => {
    // $ExpectError
    waitForElement(1);
    // $ExpectError
    waitForElement(() => {}, 1);
  });
github flow-typed / flow-typed / definitions / npm / react-testing-library_v5.x.x / flow_v0.67.1- / test_react-testing-library_v5.x.x.js View on Github external
it('should fail on invalid inputs', () => {
    // $ExpectError
    waitForElement(1);
    // $ExpectError
    waitForElement(() => {}, 1);
  });
github elastic / kibana / x-pack / plugins / apm / public / utils / testHelpers.tsx View on Github external
export async function getRenderedHref(Component: React.FC, location: Location) {
  const el = render(
    
      
        
      
    
  );

  await tick();
  await waitForElement(() => el.container.querySelector('a'));

  const a = el.container.querySelector('a');
  return a ? a.getAttribute('href') : '';
}