[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Organize linter tests by category

2017-08-12 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371056 )

Change subject: Organize linter tests by category
..


Organize linter tests by category

Change-Id: I61f0377238eb2e51de22a706ef81ab7351647a44
---
M tests/mocha/linter.js
1 file changed, 31 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified
  Jforrester: Looks good to me, but someone else must approve
  Arlolra: Looks good to me, approved



diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index 969e63e..49f1750 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -29,6 +29,9 @@
return result.should.be.empty;
});
});
+   });
+
+   describe('MISSING END TAGS', function() {
it('should lint missing end tags correctly', function() {
return parseWT('foo').then(function(result) {
result.should.have.length(1);
@@ -49,6 +52,9 @@
result[0].params.should.have.a.property("name", 
"p");
});
});
+   });
+
+   describe('STRIPPED TAGS', function() {
it('should lint stripped tags correctly', function() {
return parseWT('foo').then(function(result) {
result.should.have.length(1);
@@ -116,6 +122,9 @@
result[0].params.should.have.a.property("name", 
"small");
});
});
+   });
+
+   describe('OBSOLETE TAGS', function() {
it('should lint obsolete tags correctly', function() {
return parseWT('foobar').then(function(result) 
{
result.should.have.length(1);
@@ -152,6 +161,9 @@
result[1].params.should.have.a.property("name", 
"tt");
});
});
+   });
+
+   describe('FOSTERED CONTENT', function() {
it('should lint fostered content correctly', function() {
return parseWT('{|\nfoo\n|-\n| 
bar\n|}').then(function(result) {
result.should.have.length(1);
@@ -180,7 +192,10 @@
result[0].should.have.a.property("type", 
"fostered");
});
});
-   it('should lint ignored table attributes Correctly', function() 
{
+   });
+
+   describe('IGNORED TABLE ATTRIBUTES', function() {
+   it('should lint ignored table attributes correctly', function() 
{
return parseWT('{|\n|- 
foo\n|bar\n|}').then(function(result) {
result.should.have.length(1);
result[0].should.have.a.property("type", 
"ignored-table-attr");
@@ -208,6 +223,9 @@
result[0].dsr.should.deep.equal([ 3, 30, 22, 0 
]);
});
});
+   });
+
+   describe('BOGUS IMAGE OPTIONS', function() {
it('should lint Bogus image options correctly', function() {
return 
parseWT('[[file:a.jpg|foo|bar]]').then(function(result) {
result.should.have.length(1);
@@ -259,6 +277,9 @@
result.should.have.length(0);
});
});
+   });
+
+   describe('SELF-CLOSING TAGS', function() {
it('should lint self-closing tags corrrectly', function() {
return parseWT('foobarbazboo 
').then(function(result) {
result.should.have.length(2);
@@ -283,6 +304,9 @@

result[0].templateInfo.should.have.a.property("name", "Template:1x");
});
});
+   });
+
+   describe('MIXED-CONTENT TEMPLATES', function() {
it('should lint mixed-content templates', function() {
return parseWT('{{1x|*}}hi').then(function(result) {
result.should.have.length(1);
@@ -297,6 +321,9 @@
result[0].dsr.should.deep.equal([ 0, 17, null, 
null ]);
});
});
+   });
+
+   describe('DELETABLE TABLE TAG', function() {
it('should identify deletable table tag for T161341 (1)', 
function() {
var wt = [
"{| style='border:1px solid red;'",
@@ -374,6 +401,9 @@
result[1].dsr.should.deep.equal([ 29, 31, 0, 0 
]);
});
});
+   });
+
+   describe('PWRAP BUG WORKAROUND', function() {
  

[MediaWiki-commits] [Gerrit] mediawiki...parsoid[master]: Organize linter tests by category

2017-08-10 Thread Subramanya Sastry (Code Review)
Subramanya Sastry has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371056 )

Change subject: Organize linter tests by category
..

Organize linter tests by category

Change-Id: I61f0377238eb2e51de22a706ef81ab7351647a44
---
M tests/mocha/linter.js
1 file changed, 31 insertions(+), 1 deletion(-)


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

diff --git a/tests/mocha/linter.js b/tests/mocha/linter.js
index 969e63e..49f1750 100644
--- a/tests/mocha/linter.js
+++ b/tests/mocha/linter.js
@@ -29,6 +29,9 @@
return result.should.be.empty;
});
});
+   });
+
+   describe('MISSING END TAGS', function() {
it('should lint missing end tags correctly', function() {
return parseWT('foo').then(function(result) {
result.should.have.length(1);
@@ -49,6 +52,9 @@
result[0].params.should.have.a.property("name", 
"p");
});
});
+   });
+
+   describe('STRIPPED TAGS', function() {
it('should lint stripped tags correctly', function() {
return parseWT('foo').then(function(result) {
result.should.have.length(1);
@@ -116,6 +122,9 @@
result[0].params.should.have.a.property("name", 
"small");
});
});
+   });
+
+   describe('OBSOLETE TAGS', function() {
it('should lint obsolete tags correctly', function() {
return parseWT('foobar').then(function(result) 
{
result.should.have.length(1);
@@ -152,6 +161,9 @@
result[1].params.should.have.a.property("name", 
"tt");
});
});
+   });
+
+   describe('FOSTERED CONTENT', function() {
it('should lint fostered content correctly', function() {
return parseWT('{|\nfoo\n|-\n| 
bar\n|}').then(function(result) {
result.should.have.length(1);
@@ -180,7 +192,10 @@
result[0].should.have.a.property("type", 
"fostered");
});
});
-   it('should lint ignored table attributes Correctly', function() 
{
+   });
+
+   describe('IGNORED TABLE ATTRIBUTES', function() {
+   it('should lint ignored table attributes correctly', function() 
{
return parseWT('{|\n|- 
foo\n|bar\n|}').then(function(result) {
result.should.have.length(1);
result[0].should.have.a.property("type", 
"ignored-table-attr");
@@ -208,6 +223,9 @@
result[0].dsr.should.deep.equal([ 3, 30, 22, 0 
]);
});
});
+   });
+
+   describe('BOGUS IMAGE OPTIONS', function() {
it('should lint Bogus image options correctly', function() {
return 
parseWT('[[file:a.jpg|foo|bar]]').then(function(result) {
result.should.have.length(1);
@@ -259,6 +277,9 @@
result.should.have.length(0);
});
});
+   });
+
+   describe('SELF-CLOSING TAGS', function() {
it('should lint self-closing tags corrrectly', function() {
return parseWT('foobarbazboo 
').then(function(result) {
result.should.have.length(2);
@@ -283,6 +304,9 @@

result[0].templateInfo.should.have.a.property("name", "Template:1x");
});
});
+   });
+
+   describe('MIXED-CONTENT TEMPLATES', function() {
it('should lint mixed-content templates', function() {
return parseWT('{{1x|*}}hi').then(function(result) {
result.should.have.length(1);
@@ -297,6 +321,9 @@
result[0].dsr.should.deep.equal([ 0, 17, null, 
null ]);
});
});
+   });
+
+   describe('DELETABLE TABLE TAG', function() {
it('should identify deletable table tag for T161341 (1)', 
function() {
var wt = [
"{| style='border:1px solid red;'",
@@ -374,6 +401,9 @@
result[1].dsr.should.deep.equal([ 29, 31, 0, 0 
]);
});
});
+   });
+
+   describe('PWRAP BUG WORKAROUND', function() {
it('should identify rendering workarounds needed for 
doBlockLevels