mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { Liquid } from '../..'
|
||
import { expect, use } from 'chai'
|
||
import * as chaiAsPromised from 'chai-as-promised'
|
||
|
||
use(chaiAsPromised)
|
||
|
||
describe('Issues', function () {
|
||
it('#221 unicode blanks are not properly treated', async () => {
|
||
const engine = new Liquid({ strictVariables: true, strictFilters: true })
|
||
const html = engine.parseAndRenderSync('{{huh | truncate: 11}}', { huh: 'fdsafdsafdsafdsaaaaa' })
|
||
expect(html).to.equal('fdsafdsa...')
|
||
})
|
||
it('#252 "Not valid identifier" error for a quotes-containing identifier', async () => {
|
||
const template = `{% capture "form_classes" -%}
|
||
foo
|
||
{%- endcapture %}{{form_classes}}`
|
||
const engine = new Liquid()
|
||
const html = await engine.parseAndRender(template)
|
||
expect(html).to.equal('foo')
|
||
})
|
||
it('#259 complex property access with braces is not supported', async () => {
|
||
const engine = new Liquid()
|
||
const html = engine.parseAndRenderSync('{{ ["complex key"] }}', { 'complex key': 'foo' })
|
||
expect(html).to.equal('foo')
|
||
})
|
||
})
|