Unit tests for jquery.localize
authorKrinkle <krinkle@users.mediawiki.org>
Wed, 13 Jul 2011 22:37:51 +0000 (22:37 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Wed, 13 Jul 2011 22:37:51 +0000 (22:37 +0000)
commita786ef815a96f5841369270615352960a51980a6
tree92581695a1e4e4e5fee799d6600afe4f11ecb48c
parentde96e923680e543c89d4f2533e48a7c261230ef1
Unit tests for jquery.localize
(Follow-up r92069)

Also fixing a bug in jquery.localize. Previously it did mw.msg(key, [p1, p2, ...]); (passing an array as second argument), however mw.msg doesn't take an array as second argument, instead the second argument is the first in a list of optional variadic arguments. (like mw.msg(key, p1, p2, ..);

In cases were only 1 variable is passed, this didn't brake the test as [p1].toString() === p1. Fixing by using .apply instead and creating an array of arguments, starting with the key (unshifted) and if available adding parameters.

All these tests appear to be broken in Gecko-browsers because it uses a different attribute order (WebKit moslty in order of touch, Gecko mostly alphabetical, Trident/Presto engine different too). They are reported because the elements are compared as strings. I'll fix this in a better way when I think of one (soon!)
resources/jquery/jquery.localize.js
tests/qunit/index.html
tests/qunit/suites/resources/jquery/jquery.localize.js [new file with mode: 0644]