X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fqunit%2Fsuites%2Fresources%2Fmediawiki%2Fmediawiki.loader.test.js;h=fcf80bde22d97e26e23b9856678edb01bd63404e;hb=1e9c3619;hp=92d13260e9f92813f801722d1b8517be3a1d3e41;hpb=7e2e2db806f621c61851bc9df32e398a5a6d345e;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js index 92d13260e9..fcf80bde22 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js @@ -127,7 +127,6 @@ .done( function () { assert.strictEqual( isAwesomeDone, true, 'test.promise module should\'ve caused isAwesomeDone to be true' ); delete mw.loader.testCallback; - } ) .fail( function () { assert.ok( false, 'Error callback fired while loader.using "test.promise" module' ); @@ -135,6 +134,8 @@ } ); QUnit.test( '.using() Error: Circular dependency', function ( assert ) { + var done = assert.async(); + mw.loader.register( [ [ 'test.circle1', '0', [ 'test.circle2' ] ], [ 'test.circle2', '0', [ 'test.circle3' ] ], @@ -147,7 +148,8 @@ function fail( e ) { assert.ok( /Circular/.test( String( e ) ), 'Detect circular dependency' ); } - ); + ) + .always( done ); } ); QUnit.test( '.load() - Error: Circular dependency', function ( assert ) { @@ -162,6 +164,8 @@ } ); QUnit.test( '.using() - Error: Unregistered', function ( assert ) { + var done = assert.async(); + mw.loader.using( 'test.using.unreg' ).then( function done() { assert.ok( false, 'Unexpected resolution, expected error.' ); @@ -169,7 +173,7 @@ function fail( e ) { assert.ok( /Unknown/.test( String( e ) ), 'Detect unknown dependency' ); } - ); + ).always( done ); } ); QUnit.test( '.load() - Error: Unregistered (ignored)', 0, function ( assert ) { @@ -252,7 +256,7 @@ url: { print: [ urlStyleTest( '.mw-test-implement-b1', 'text-align', 'center' ) ], screen: [ - // bug 40834: Make sure it actually works with more than 1 stylesheet reference + // T42834: Make sure it actually works with more than 1 stylesheet reference urlStyleTest( '.mw-test-implement-b2', 'float', 'left' ), urlStyleTest( '.mw-test-implement-b3', 'float', 'right' ) ] @@ -311,7 +315,7 @@ 'test.implement.d', function () { assertStyleAsync( assert, $element, 'float', 'right', function () { - assert.notEqual( $element2.css( 'text-align' ), 'center', 'print style is not applied (bug 40500)' ); + assert.notEqual( $element2.css( 'text-align' ), 'center', 'print style is not applied (T42500)' ); done(); } ); }, @@ -324,7 +328,7 @@ mw.loader.load( 'test.implement.d' ); } ); - // @import (bug 31676) + // @import (T33676) QUnit.test( '.implement( styles has @import )', 7, function ( assert ) { var isJsExecuted, $element, done = assert.async(); @@ -425,14 +429,12 @@ } ); QUnit.test( '.implement( only messages )', 2, function ( assert ) { - assert.assertFalse( mw.messages.exists( 'bug_29107' ), 'Verify that the test message doesn\'t exist yet' ); + assert.assertFalse( mw.messages.exists( 'T31107' ), 'Verify that the test message doesn\'t exist yet' ); - // jscs: disable requireCamelCaseOrUpperCaseIdentifiers - mw.loader.implement( 'test.implement.msgs', [], {}, { bug_29107: 'loaded' } ); - // jscs: enable requireCamelCaseOrUpperCaseIdentifiers + mw.loader.implement( 'test.implement.msgs', [], {}, { T31107: 'loaded' } ); return mw.loader.using( 'test.implement.msgs', function () { - assert.ok( mw.messages.exists( 'bug_29107' ), 'Bug 29107: messages-only module should implement ok' ); + assert.ok( mw.messages.exists( 'T31107' ), 'T31107: messages-only module should implement ok' ); }, function () { assert.ok( false, 'Error callback fired while implementing "test.implement.msgs" module' ); } );