Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/173253
Change subject: WIP Floundering attempt to protect async, dynamic test creation
from QUnit cleanup
......................................................................
WIP Floundering attempt to protect async, dynamic test creation from QUnit
cleanup
Change-Id: I90e44636d5807832c408a47c62084733cb654fb6
---
M
tests/qunit/ext.centralNotice.bannerController.lib/bannerController.lib.tests.js
1 file changed, 21 insertions(+), 13 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice
refs/changes/53/173253/1
diff --git
a/tests/qunit/ext.centralNotice.bannerController.lib/bannerController.lib.tests.js
b/tests/qunit/ext.centralNotice.bannerController.lib/bannerController.lib.tests.js
index b3a8ca6..d606cc6 100644
---
a/tests/qunit/ext.centralNotice.bannerController.lib/bannerController.lib.tests.js
+++
b/tests/qunit/ext.centralNotice.bannerController.lib/bannerController.lib.tests.js
@@ -11,23 +11,31 @@
}
} ) );
- $.ajax( {
- url: mw.config.get( 'wgExtensionAssetsPath' )
- + '/CentralNotice/tests/data/AllocationsFixtures.json'
- } ).done( function( responseData ) {
- responseData.forEach( function( testCaseData ) {
- var data = testCaseData[0],
- lib = mw.cnBannerControllerLib;
+ QUnit.asyncTest( 'prepare test cases :-$', 1, function( assert ) {
+ //QUnit.stop();
- QUnit.test( data.title, 1, function( assert ) {
- lib.setChoiceData( data.choices );
- lib.filterChoiceData();
- var allocations =
lib.calculateBannerAllocations();
+ $.ajax( {
+ url: mw.config.get( 'wgExtensionAssetsPath' )
+ +
'/CentralNotice/tests/data/AllocationsFixtures.json'
+ } ).done( function( responseData ) {
+ responseData.forEach( function( testCaseData ) {
+ var data = testCaseData[0],
+ lib = mw.cnBannerControllerLib;
- assert.deepEqual( allocations, data.allocations
);
+ QUnit.test( data.title, 1, function( assert ) {
+ lib.setChoiceData( data.choices );
+ lib.filterChoiceData();
+ var allocations =
lib.calculateBannerAllocations();
+
+ assert.deepEqual( allocations,
data.allocations );
+ } );
+
} );
-
} );
+// setTimeout(function() {
+// assert.ok( true, "Passed and ready to resume!" );
+// QUnit.start();
+// }, 1000);
} );
// TODO: chooser tests
--
To view, visit https://gerrit.wikimedia.org/r/173253
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I90e44636d5807832c408a47c62084733cb654fb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits