Cscott has uploaded a new change for review.

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

Change subject: Better coverage of pagebundle POST API endpoint.
......................................................................

Better coverage of pagebundle POST API endpoint.

Change-Id: Ic97f9364282474aeff199123d7e04ce6e576c80c
---
M tests/mocha/api.js
1 file changed, 24 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/83/252583/1

diff --git a/tests/mocha/api.js b/tests/mocha/api.js
index e2337b2..85ed66f 100644
--- a/tests/mocha/api.js
+++ b/tests/mocha/api.js
@@ -358,7 +358,7 @@
                                .end(done);
                        });
 
-                       it('should require a title when no wikitext is 
provided', function(done) {
+                       it('should require a title when no wikitext is provided 
(html)', function(done) {
                                request(api)
                                .post(version === 3 ?
                                        mockDomain + 
'/v3/transform/wikitext/to/html/' :
@@ -368,7 +368,17 @@
                                .end(done);
                        });
 
-                       it('should not require a title when empty wikitext is 
provided', function(done) {
+                       it('should require a title when no wikitext is provided 
(pagebundle)', function(done) {
+                               request(api)
+                               .post(version === 3 ?
+                                       mockDomain + 
'/v3/transform/wikitext/to/pagebundle/' :
+                                       'v2/' + mockDomain + '/pagebundle/')
+                               .send()
+                               .expect(400)
+                               .end(done);
+                       });
+
+                       it('should not require a title when empty wikitext is 
provided (html)', function(done) {
                                request(api)
                                .post(version === 3 ?
                                        mockDomain + 
'/v3/transform/wikitext/to/html/' :
@@ -382,6 +392,18 @@
                                .end(done);
                        });
 
+                       it('should not require a title when empty wikitext is 
provided (pagebundle)', function(done) {
+                               request(api)
+                               .post(version === 3 ?
+                                       mockDomain + 
'/v3/transform/wikitext/to/pagebundle/' :
+                                       'v2/' + mockDomain + '/pagebundle/')
+                               .send({
+                                       wikitext: '',
+                               })
+                               .expect(validPageBundleResponse())
+                               .end(done);
+                       });
+
                        it('should not require a title when wikitext is 
provided', function(done) {
                                request(api)
                                .post(version === 3 ?

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic97f9364282474aeff199123d7e04ce6e576c80c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to