X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fqunit%2Fsuites%2Fresources%2Fjquery%2Fjquery.hidpi.test.js;h=cb09180b2161cddd861ec07cf6c6c8593ea84e5c;hp=6a265eb591eadeb5d3326ff6d783c02c8deba4d0;hb=1de7117197761961736ea43b237599569eee93a2;hpb=6d2198bdcbcea3836d70a04744c53ad6d31e5116 diff --git a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js index 6a265eb591..cb09180b21 100644 --- a/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.hidpi.test.js @@ -1,38 +1,38 @@ -( function ( $ ) { +( function () { QUnit.module( 'jquery.hidpi', QUnit.newMwEnvironment() ); QUnit.test( 'devicePixelRatio', function ( assert ) { var devicePixelRatio = $.devicePixelRatio(); - assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' ); + assert.strictEqual( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' ); } ); QUnit.test( 'bracketedDevicePixelRatio', function ( assert ) { var ratio = $.bracketedDevicePixelRatio(); - assert.equal( typeof ratio, 'number', '$.bracketedDevicePixelRatio() returns a number' ); + assert.strictEqual( typeof ratio, 'number', '$.bracketedDevicePixelRatio() returns a number' ); } ); QUnit.test( 'bracketDevicePixelRatio', function ( assert ) { - assert.equal( $.bracketDevicePixelRatio( 0.75 ), 1, '0.75 gives 1' ); - assert.equal( $.bracketDevicePixelRatio( 1 ), 1, '1 gives 1' ); - assert.equal( $.bracketDevicePixelRatio( 1.25 ), 1.5, '1.25 gives 1.5' ); - assert.equal( $.bracketDevicePixelRatio( 1.5 ), 1.5, '1.5 gives 1.5' ); - assert.equal( $.bracketDevicePixelRatio( 1.75 ), 2, '1.75 gives 2' ); - assert.equal( $.bracketDevicePixelRatio( 2 ), 2, '2 gives 2' ); - assert.equal( $.bracketDevicePixelRatio( 2.5 ), 2, '2.5 gives 2' ); - assert.equal( $.bracketDevicePixelRatio( 3 ), 2, '3 gives 2' ); + assert.strictEqual( $.bracketDevicePixelRatio( 0.75 ), 1, '0.75 gives 1' ); + assert.strictEqual( $.bracketDevicePixelRatio( 1 ), 1, '1 gives 1' ); + assert.strictEqual( $.bracketDevicePixelRatio( 1.25 ), 1.5, '1.25 gives 1.5' ); + assert.strictEqual( $.bracketDevicePixelRatio( 1.5 ), 1.5, '1.5 gives 1.5' ); + assert.strictEqual( $.bracketDevicePixelRatio( 1.75 ), 2, '1.75 gives 2' ); + assert.strictEqual( $.bracketDevicePixelRatio( 2 ), 2, '2 gives 2' ); + assert.strictEqual( $.bracketDevicePixelRatio( 2.5 ), 2, '2.5 gives 2' ); + assert.strictEqual( $.bracketDevicePixelRatio( 3 ), 2, '3 gives 2' ); } ); QUnit.test( 'matchSrcSet', function ( assert ) { var srcset = 'onefive.png 1.5x, two.png 2x'; // Nice exact matches - assert.equal( $.matchSrcSet( 1, srcset ), null, '1.0 gives no match' ); - assert.equal( $.matchSrcSet( 1.5, srcset ), 'onefive.png', '1.5 gives match' ); - assert.equal( $.matchSrcSet( 2, srcset ), 'two.png', '2 gives match' ); + assert.strictEqual( $.matchSrcSet( 1, srcset ), null, '1.0 gives no match' ); + assert.strictEqual( $.matchSrcSet( 1.5, srcset ), 'onefive.png', '1.5 gives match' ); + assert.strictEqual( $.matchSrcSet( 2, srcset ), 'two.png', '2 gives match' ); // Non-exact matches; should return the next-biggest specified - assert.equal( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' ); - assert.equal( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' ); - assert.equal( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' ); + assert.strictEqual( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' ); + assert.strictEqual( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' ); + assert.strictEqual( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' ); } ); -}( jQuery ) ); +}() );