diff --git a/test/tags/comment.js b/test/tags/comment.js index 946d18911..87b6878c2 100644 --- a/test/tags/comment.js +++ b/test/tags/comment.js @@ -5,19 +5,29 @@ chai.use(require('chai-as-promised')) describe('tags/comment', function () { var liquid = Liquid() - it('should support comment 1', function () { + it('should support empty content', function () { var src = '{% comment %}{% raw%}' return expect(liquid.parseAndRender(src)) .to.be.rejectedWith(/{% comment %} not closed/) }) - it('should support comment 2', function () { + it('should ignore plain string', function () { var src = 'My name is {% comment %}super{% endcomment %} Shopify.' return expect(liquid.parseAndRender(src)) .to.eventually.equal('My name is Shopify.') }) - it('should support comment 3', function () { + it('should ignore output tokens', function () { var src = '{% comment %}\n{{ foo}} \n{% endcomment %}' return expect(liquid.parseAndRender(src)) .to.eventually.equal('') }) + it('should ignore tag tokens', function () { + var src = '{% comment %}{%if true%}true{%else%}false{%endif%}{% endcomment %}' + return expect(liquid.parseAndRender(src)) + .to.eventually.equal('') + }) + it('should ignore un-balenced tag tokens', function () { + var src = '{% comment %}{%if true%}true{%else%}false{% endcomment %}' + return expect(liquid.parseAndRender(src)) + .to.eventually.equal('') + }) })