Mholloway has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/289320

Change subject: Fix tests to reflect updated page protection response format
......................................................................

Fix tests to reflect updated page protection response format

As a result of T69054, the value of a lead response's "protection" field
for an unprotected page is now an empty object rather than an empty array,
which confused a couple of our tests; this fixes them.

Change-Id: I09cea13e797c71345c408eb336ebd96286646366
---
M test/features/mobile-sections-lead/pagecontent.js
M test/features/mobile-sections/pagecontent.js
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/20/289320/1

diff --git a/test/features/mobile-sections-lead/pagecontent.js 
b/test/features/mobile-sections-lead/pagecontent.js
index 93c3d0f..b2d0abf 100644
--- a/test/features/mobile-sections-lead/pagecontent.js
+++ b/test/features/mobile-sections-lead/pagecontent.js
@@ -21,7 +21,7 @@
                 assert.deepEqual(res.status, 200);
                 assert.ok(lead.lastmodified.startsWith('201'), 
lead.lastmodified + ' should start with 201'); // 2015-
                 assert.deepEqual(lead.displaytitle, 'Sections/deep');
-                assert.ok(!lead.protection, 'Page should not be protected');
+                assert.ok(!lead.protection.length, 'Page should not be 
protected');
                 assert.deepEqual(lead.editable, true);
                 assert.ok(lead.sections.length >= 6, 'Expected at least six 
section elements');
                 assert.deepEqual(lead.sections[0].id, 0);
diff --git a/test/features/mobile-sections/pagecontent.js 
b/test/features/mobile-sections/pagecontent.js
index b7c5a35..d24d797 100644
--- a/test/features/mobile-sections/pagecontent.js
+++ b/test/features/mobile-sections/pagecontent.js
@@ -29,10 +29,11 @@
         return preq.get({ uri: server.config.uri + 
'test.wikipedia.org/v1/page/mobile-sections/Sections%2Fdeep' })
             .then(function(res) {
                 var lead = res.body.lead;
+                console.log(lead.protection);
                 assert.deepEqual(res.status, 200);
                 assert.ok(lead.lastmodified.startsWith('201'), 
lead.lastmodified + ' should start with 201'); // 2015-
                 assert.deepEqual(lead.displaytitle, 'Sections/deep');
-                assert.ok(!lead.protection, 'Page should not be protected');
+                assert.ok(!lead.protection.length, 'Page should not be 
protected');
                 assert.deepEqual(lead.editable, true);
                 assert.ok(lead.sections.length >= 6, 'Expected at least six 
section elements');
                 assert.deepEqual(lead.sections[0].id, 0);

-- 
To view, visit https://gerrit.wikimedia.org/r/289320
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09cea13e797c71345c408eb336ebd96286646366
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Mholloway <mhollo...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to