Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APM] Update unit tests removing 'waitForElement' from @testing-library/react #79441

Closed
cauemarcondes opened this issue Oct 5, 2020 · 3 comments
Labels
Team:APM - DEPRECATED Use Team:obs-ux-infra_services. technical debt Improvement of the software architecture and operational architecture

Comments

@cauemarcondes
Copy link
Contributor

cauemarcondes commented Oct 5, 2020

After upgrading @testing-library/react some tests are printing warning saying that waitForElement was deprecated. More detail here: https://testing-library.com/docs/dom-testing-library/api-async#waitforelement-deprecated-use-find-queries-or-waitfor

 PASS  plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.test.tsx
   Console

    console.warn
      `waitForElement` has been deprecated. Use a `find*` query (preferred: https://testing-library.com/docs/dom-testing-library/api-queries#findby) or use `waitFor` instead: https://testing-library.com/docs/dom-testing-library/api-async#waitfor

      77 |   );
      78 | 
    > 79 |   await waitForElement(() => el.container.querySelector('a'));
         |         ^
      80 | 
      81 |   const a = el.container.querySelector('a');
      82 |   return a ? a.getAttribute('href') : '';

      at waitForElement (../node_modules/@testing-library/dom/dist/wait-for-element.js:17:13)
      at getRenderedHref (plugins/apm/public/utils/testHelpers.tsx:79:9)
      at Object.<anonymous>.test (plugins/apm/public/components/shared/Links/MachineLearningLinks/MLLink.test.tsx:13:22)
@cauemarcondes cauemarcondes added [zube]: Inbox Team:APM - DEPRECATED Use Team:obs-ux-infra_services. technical debt Improvement of the software architecture and operational architecture labels Oct 5, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

@cauemarcondes cauemarcondes changed the title [APM] Update functional test removing 'waitForElement' from @testing-library/react [APM] Update unit tests removing 'waitForElement' from @testing-library/react Oct 5, 2020
@smith
Copy link
Contributor

smith commented Oct 5, 2020

@cauemarcondes I fixed all of these in #79305.

@cauemarcondes
Copy link
Contributor Author

thanks @smith, closing it!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:APM - DEPRECATED Use Team:obs-ux-infra_services. technical debt Improvement of the software architecture and operational architecture
Projects
None yet
Development

No branches or pull requests

4 participants