Page MenuHomePhabricator

jquery.tablesorter.test.js broken for $wgLanguageCode != en
Closed, ResolvedPublic

Description

jquery.tablesorter.test.js is using the mediawiki.language.months module, but that is always loaded in the content language

That means some tests (for complex date parsing) gets broken, when $wgLanguageCode is not 'en'.


Version: 1.23.0
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=34093

Details

Reference
bz57776

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:32 AM
bzimport set Reference to bz57776.
bzimport added a subscriber: Unknown Object (MLST).

Same thing as bug 34093?

No, that bug is about the transform tables, this bug is about the month names.

The test contains wgMonthNames, but since gerrit 55496 the module mediawiki.language.months is used for building the regex instead of the config var, that means the test needs also adjust, because the regex cannot match against the given test data.
But I have no idea to force the load of a module in a other language inside of a QUnit test.

Ughhh. I'm afraid you can't do that.

I'd just overwrite the values in mw.language.months.* from the test runner to English ones (or fix the tests not to depend on that).

(Disclaimer: haven't looked at the code.)

hashar removed a subscriber: hashar.Dec 21 2014, 10:25 PM

Change 199241 had a related patch set uploaded (by Gerrit Patch Uploader):
Make all QUnit tests pass for languages other than English

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

Change 199241 merged by jenkins-bot:
Make all QUnit tests pass for languages other than English

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

Umherirrender closed this task as Resolved.Apr 1 2015, 7:56 PM
Umherirrender assigned this task to Schnark.
Umherirrender set Security to None.
hashar awarded a token.Apr 1 2015, 9:52 PM
hashar added a subscriber: hashar.

It is really great to see this test finally fixed. I love the use of mocking!