mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -07:00
test: cover parseFilters in template/value.ts
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { test, liquid } from '../../stub/render'
|
import { test, liquid } from '../../stub/render'
|
||||||
|
|
||||||
describe('registerFilter', function () {
|
describe('liquid#registerFilter()', function () {
|
||||||
describe('object arguments', function () {
|
describe('object arguments', function () {
|
||||||
liquid.registerFilter('obj_test', function () {
|
liquid.registerFilter('obj_test', function () {
|
||||||
return JSON.stringify(arguments)
|
return JSON.stringify(arguments)
|
||||||
@@ -25,6 +25,12 @@ describe('Value', function () {
|
|||||||
expect(tpl.filters.length).to.equal(1)
|
expect(tpl.filters.length).to.equal(1)
|
||||||
expect(tpl.filters[0].args).to.eql([])
|
expect(tpl.filters[0].args).to.eql([])
|
||||||
})
|
})
|
||||||
|
it('should parse "foo,foo | add"', function () {
|
||||||
|
const tpl = new Value('foo,foo | add', false)
|
||||||
|
expect(tpl.initial).to.equal('foo')
|
||||||
|
expect(tpl.filters.length).to.equal(1)
|
||||||
|
expect(tpl.filters[0].args).to.eql([])
|
||||||
|
})
|
||||||
it('should parse "foo | add: 3, false"', function () {
|
it('should parse "foo | add: 3, false"', function () {
|
||||||
const tpl = new Value('foo | add: 3, "foo"', false)
|
const tpl = new Value('foo | add: 3, "foo"', false)
|
||||||
expect(tpl.initial).to.equal('foo')
|
expect(tpl.initial).to.equal('foo')
|
||||||
|
|||||||
Reference in New Issue
Block a user