diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-08-12 09:28:15 +0200 |
commit | 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 (patch) | |
tree | 577a29fb579188d16003a209ce2a2e9c5b0aa2bd /tests/qunit/suites/resources/mediawiki.api | |
parent | cacc939b34e315b85e2d72997811eb6677996cc1 (diff) |
Update to MediaWiki 1.21.1
Diffstat (limited to 'tests/qunit/suites/resources/mediawiki.api')
-rw-r--r-- | tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js | 26 | ||||
-rw-r--r-- | tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js | 59 |
2 files changed, 0 insertions, 85 deletions
diff --git a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js deleted file mode 100644 index 3d3f630f..00000000 --- a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js +++ /dev/null @@ -1,26 +0,0 @@ -QUnit.module( 'mediawiki.api.parse', QUnit.newMwEnvironment() ); - -QUnit.asyncTest( 'Hello world', function ( assert ) { - var api; - QUnit.expect( 6 ); - - api = new mw.Api(); - - api.parse( "'''Hello world'''" ) - .done( function ( html ) { - // Parse into a document fragment instead of comparing HTML, due to - // presence of Tidy influencing whitespace. - // Html also contains "NewPP report" comment. - var $res = $( '<div>' ).html( html ).children(), - res = $res.get( 0 ); - assert.equal( $res.length, 1, 'Response contains 1 element' ); - assert.equal( res.nodeName.toLowerCase(), 'p', 'Response is a paragraph' ); - assert.equal( $res.children().length, 1, 'Response has 1 child element' ); - assert.equal( $res.children().get( 0 ).nodeName.toLowerCase(), 'b', 'Child element is a bold tag' ); - // Trim since Tidy may or may not mess with the spacing here - assert.equal( $.trim( $res.text() ), 'Hello world', 'Response contains given text' ); - assert.equal( $res.find( 'b' ).text(), 'Hello world', 'Bold tag wraps the entire, same, text' ); - - QUnit.start(); - }); -}); diff --git a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js deleted file mode 100644 index 79bd7306..00000000 --- a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js +++ /dev/null @@ -1,59 +0,0 @@ -QUnit.module( 'mediawiki.api', QUnit.newMwEnvironment() ); - -QUnit.asyncTest( 'Basic functionality', function ( assert ) { - var api, d1, d2, d3; - QUnit.expect( 3 ); - - api = new mw.Api(); - - d1 = api.get( {} ) - .done( function ( data ) { - assert.deepEqual( data, [], 'If request succeeds without errors, resolve deferred' ); - }); - - d2 = api.get({ - action: 'doesntexist' - }) - .fail( function ( errorCode, details ) { - assert.equal( errorCode, 'unknown_action', 'API error (e.g. "unknown_action") should reject the deferred' ); - }); - - d3 = api.post( {} ) - .done( function ( data ) { - assert.deepEqual( data, [], 'Simple POST request' ); - }); - - // After all are completed, continue the test suite. - QUnit.whenPromisesComplete( d1, d2, d3 ).always( function () { - QUnit.start(); - }); -}); - -QUnit.asyncTest( 'Deprecated callback methods', function ( assert ) { - var api, d1, d2, d3; - QUnit.expect( 3 ); - - api = new mw.Api(); - - d1 = api.get( {}, function () { - assert.ok( true, 'Function argument treated as success callback.' ); - }); - - d2 = api.get( {}, { - ok: function ( data ) { - assert.ok( true, '"ok" property treated as success callback.' ); - } - }); - - d3 = api.get({ - action: 'doesntexist' - }, { - err: function ( data ) { - assert.ok( true, '"err" property treated as error callback.' ); - } - }); - - QUnit.whenPromisesComplete( d1, d2, d3 ).always( function () { - QUnit.start(); - }); -}); |