Page MenuHomePhabricator

Write unit tests for Thanks JS modules
Open, Needs TriagePublic

Description

Of the five JavaScript modules in Thanks, only ext.thanks.mobilediff.js currently has a QUnit test module. Tests should be written for the remaining four modules:

Notes

  • 2 tests per GCI participant so this will be a task with 2 instant counts for the 4 tests to be written.
  • Patches should indicate which tests have been added (in commit message as well).

Event Timeline

jquery.findWithParent.js was copied from Flow, so that unit test should be added there.

xSavitar added a subscriber: xSavitar.

Imported as: https://codein.withgoogle.com/tasks/5802758423707648/. Will give a helping hand to @Framawiki in mentoring this.

@D3r1ck01: On the GCI site, I've split this into two tasks so students do not collide with choosing which tests to work on, set the category to QA as this is about testing, and added links to the extension homepages and explained the expected outcome (patches in Gerrit):
https://codein.withgoogle.com/tasks/5802758423707648/ https://codein.withgoogle.com/tasks/5059170198880256/

Thanks so much @Aklapper. Indeed this will solve the collision problem you highlighted :)

KacasPiesel added a subscriber: KacasPiesel.

Change 473281 had a related patch set uploaded (by Takidelfin; owner: Takidelfin):
[mediawiki/extensions/Thanks@master] Thanks/thank: Add tests for thanked cookie and getUserGender()

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

Change 473556 had a related patch set uploaded (by Flutterish; owner: Flutterish):
[mediawiki/extensions/Thanks@master] Written QUnit tests

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

Change 473592 had a related patch set uploaded (by Takidelfin; owner: Takidelfin):
[mediawiki/extensions/Flow@master] jQuery/findWithParent: Add QUnit tests

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

Change 473592 merged by jenkins-bot:
[mediawiki/extensions/Flow@master] jquery.findWithParent.js: Add QUnit tests

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

Change 473281 merged by jenkins-bot:
[mediawiki/extensions/Thanks@master] Thanks/thank: Add tests for thanked cookie and getUserGender()

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

Patch https://gerrit.wikimedia.org/r/473556 is blocked by a mysterious test failure that I can't reproduce locally. I have approved the relevant GCI task, but this Phabricator task is not fixed until someone figures that one out, or writes unit tests from scratch and doesn't run into this failure.