Page MenuHomePhabricator

Integration Tests: Look into testing-library to improve test readability
Closed, ResolvedPublic

Description

Description

Look into any existing external libraries we could use to improve component selection in tests to

  1. improve readability of tests by selecting User facing labels/text rather than class selectors.
  2. avoid having to update tests in the future due to DOM structure refactors.

Suggested library: https://github.com/testing-library/vue-testing-library

Also, look into using waitFor method in this testing library instead of explicitly choosing a number of ticks in our current awaitTicks method.
https://testing-library.com/docs/dom-testing-library/api-async/#waitfor

See discussion on patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/839618

Desired behavior/Acceptance criteria
n/a

Devices and Design (URLs or screenshots)
n/a

  • Desktop: ...
  • Small screens/mobile: ...

n/a

Completion checklist

Event Timeline

This comment was removed by Ddwaal.

Change 858630 had a related patch set uploaded (by EWright; author: EWright):

[mediawiki/extensions/WikiLambda@master] Cease running Jest tests in Vue compat mode.

https://gerrit.wikimedia.org/r/858630

Change 859058 had a related patch set uploaded (by EWright; author: EWright):

[mediawiki/extensions/WikiLambda@master] Use Vue Testing Library in all FE integration tests.

https://gerrit.wikimedia.org/r/859058

(adding back onto Phase Theta board to reflect conversation at last Experience Planning meeting, where it was agreed I would prioritise this)

Change 858630 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Run app in Vue 3 mode.

https://gerrit.wikimedia.org/r/858630

Change 859058 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Use Vue Testing Library in all FE integration tests.

https://gerrit.wikimedia.org/r/859058