CategoryOverlay contains a lot of glue code like most Overlays do. This in itself isn't inappropriate but it also touches many details which makes the code large, monolithic, and unwieldy to read, modify, and test. This task encompasses the work to break apart CategoryOverlay into separate view, gateway + marshaling, and overlay responsibilities as well as adding tests for each of these components to avoid regressions.
Some groundwork has been done in T191987:
- Fix bugs, simplify, and split up logic in the overlay, add tests to the gateway: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/460986
- Split out the view: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/461827
While doing so we will add tests. This will give us much needed information on how to improve all our overlays going forward, while providing some much needed maintenance to the category overlay.
Understandably given the process with which the feature got made, the existing category feature in beta has no unit tests or browser tests. This is a prerequisite for putting any code to stable where we need to maintain it for millions of users and having confidence that it is serving there needs. Note that the redesign of categories may remove the need for some of these tests.
Sign off notes
- CategoryOverlay has a sufficient level of unit test coverage
- Some basic browser tests have been added for the viewing of categories (also possibly tabbing)
- This will be easier once categories have been ported to webpack.