Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.colorUtil.js |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' ); |
30 | 30 | |
31 | 31 | deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' ); |
32 | | - deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (transparent)' ); |
| 32 | + deepEqual( $.colorUtil.getRGB( 'transparent' ), [255, 255, 255], 'Color names (transparent)' ); |
33 | 33 | strictEqual( $.colorUtil.getRGB( 'mediaWiki' ), undefined, 'Inexisting color name' ); |
34 | 34 | }); |
35 | 35 | |
Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.autoEllipsis.js |
— | — | @@ -23,6 +23,23 @@ |
24 | 24 | test( 'Position right', function() { |
25 | 25 | expect(3); |
26 | 26 | |
| 27 | + /** |
| 28 | + * Extra QUnit assertions |
| 29 | + * Needed in order to include the expected and actual values in the output. |
| 30 | + * This way we end up with: |
| 31 | + * "Expected: > 100, Result: 99" |
| 32 | + * instead of: |
| 33 | + * "Expected: true, Result: false" |
| 34 | + */ |
| 35 | + // Expect numerical value less than or equal to X |
| 36 | + var ltOrEq = function( actual, expected, message ) { |
| 37 | + QUnit.push( actual <= expected, actual, 'less than or equal to ' + expected, message ); |
| 38 | + }; |
| 39 | + // Expect numerical value greater than X |
| 40 | + var gt = function( actual, expected, message ) { |
| 41 | + QUnit.push( actual > expected, actual, 'greater than ' + expected, message ); |
| 42 | + }; |
| 43 | + |
27 | 44 | // We need this thing to be visible, so append it to the DOM |
28 | 45 | var origText = 'This is a really long random string and there is no way it fits in 100 pixels.'; |
29 | 46 | var $wrapper = createWrappedDiv( origText ); |
— | — | @@ -35,7 +52,7 @@ |
36 | 53 | |
37 | 54 | // Check that the text fits by turning on word wrapping |
38 | 55 | $span.css( 'whiteSpace', 'nowrap' ); |
39 | | - strictEqual( $span.width() <= $span.parent().width(), true, "Text fits (span's width is no larger than its parent's width)" ); |
| 56 | + ltOrEq( $span.width(), $span.parent().width(), "Text fits (span's width is no larger than its parent's width)" ); |
40 | 57 | |
41 | 58 | // Add one character using scary black magic |
42 | 59 | var spanText = $span.text(); |
— | — | @@ -44,7 +61,7 @@ |
45 | 62 | |
46 | 63 | // Put this text in the span and verify it doesn't fit |
47 | 64 | $span.text( spanText ); |
48 | | - strictEqual( $span.width() > $span.parent().width(), true, 'Fit is maximal (adding one character makes it not fit any more)' ); |
| 65 | + gt( $span.width(), $span.parent().width(), 'Fit is maximal (adding one character makes it not fit any more)' ); |
49 | 66 | |
50 | 67 | // Clean up |
51 | 68 | $wrapper.remove(); |
Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js |
— | — | @@ -16,6 +16,7 @@ |
17 | 17 | |
18 | 18 | test( 'mw.Map', function() { |
19 | 19 | expect(15); |
| 20 | + |
20 | 21 | ok( mw.Map, 'mw.Map defined' ); |
21 | 22 | |
22 | 23 | var conf = new mw.Map(), |