fix: case should render multiple when statements

This commit is contained in:
Jun Yang
2022-12-03 00:14:47 +08:00
parent 46ffe036a8
commit d17813ef52
3 changed files with 45 additions and 14 deletions
+8
View File
@@ -71,4 +71,12 @@ describe('tags/case', function () {
const html = await liquid.parseAndRender(src)
return expect(html).to.equal('foo')
})
it('should render multiple matching branches', async function () {
const src = '{% case "b" %}' +
'{% when "a", "b" %}first' +
'{% when "b" %}second' +
'{%endcase%}'
const html = await liquid.parseAndRender(src)
return expect(html).to.equal('firstsecond')
})
})