jenkins-bot has submitted this change and it was merged.
Change subject: Test WikiGrokResponseApi.js
......................................................................
Test WikiGrokResponseApi.js
Change-Id: I87d83a3ab959be1ec43e8a591b99ca169168226d
---
A tests/qunit/modules/wikigrok/test_WikiGrokResponseApi.js
1 file changed, 35 insertions(+), 0 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/qunit/modules/wikigrok/test_WikiGrokResponseApi.js
b/tests/qunit/modules/wikigrok/test_WikiGrokResponseApi.js
new file mode 100644
index 0000000..33cad1f
--- /dev/null
+++ b/tests/qunit/modules/wikigrok/test_WikiGrokResponseApi.js
@@ -0,0 +1,35 @@
+( function ( $, M ) {
+
+ var WikiGrokResponseApi = M.require(
'modules/wikigrok/WikiGrokResponseApi' ),
+ Api = M.require( 'api' ).Api;
+
+ QUnit.module( 'MobileFrontend: WikiGrokResponseApi.js', {
+ setup: function () {
+ this.api = new WikiGrokResponseApi( {
+ itemId: 'Q764812',
+ subject: 'title',
+ version: 'a',
+ userToken: 'token',
+ taskToken: 'taskToken'
+ } );
+
+ this.spy = this.sandbox.stub( Api.prototype,
'postWithToken' );
+ }
+ } );
+
+ QUnit.test( 'recordClaims', 8, function ( assert ) {
+ var callArgs,
+ claims = [ { a: 1 }, { b: 2 } ];
+ this.api.recordClaims( claims );
+ assert.ok( this.spy.called );
+ callArgs = this.spy.getCall( 0 ).args;
+ assert.strictEqual( callArgs[0], 'edit');
+ assert.strictEqual( callArgs[1].action, 'wikigrokresponse' );
+ assert.strictEqual( callArgs[1].claims, JSON.stringify( claims
) );
+ assert.strictEqual( callArgs[1].subject_id, 'Q764812' );
+ assert.strictEqual( callArgs[1].subject, 'title' );
+ assert.strictEqual( callArgs[1].user_token, 'token' );
+ assert.strictEqual( callArgs[1].task_token, 'taskToken' );
+ } );
+
+}( jQuery, mw.mobileFrontend ) );
--
To view, visit https://gerrit.wikimedia.org/r/171549
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I87d83a3ab959be1ec43e8a591b99ca169168226d
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits