r105861 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105860‎ | r105861 | r105862 >
Date:10:23, 12 December 2011
Author:hashar
Status:ok
Tags:
Comment:
comments from r101845 on jquery.client.Test
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.client.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.client.test.js
@@ -5,8 +5,11 @@
66 ok( jQuery.client, 'jQuery.client defined' );
77 });
88
9 -var uacount = 0, uas = (function() {
 9+/** Number of user-agent defined */
 10+var uacount = 0;
1011
 12+var uas = (function() {
 13+
1114 // Object keyed by userAgent. Value is an array (human-readable name, client-profile object, navigator.platform value)
1215 // Info based on results from http://toolserver.org/~krinkle/testswarm/job/174/
1316 var uas = {
@@ -241,6 +244,8 @@
242245 });
243246
244247 // Example from WikiEditor
 248+// Make sure to use raw numbers, a string like "7.0" would fail on a
 249+// version 10 browser since in string comparaison "10" is before "7.0" :)
245250 var testMap = {
246251 'ltr': {
247252 'msie': [['>=', 7.0]],
@@ -278,7 +283,7 @@
279284 });
280285
281286 test( 'User-agent matches against WikiEditor\'s compatibility map', function() {
282 - expect( uacount * 2 );
 287+ expect( uacount * 2 ); // double since we test both LTR and RTL
283288
284289 // Loop through and run tests
285290 $.each( uas, function( agent, data ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101845Add to jquery.client's qunit tests by actually testing the test() function ag...brion18:33, 3 November 2011

Status & tagging log