mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
fix: context for group_by_exp/where_exp/find_exp, #790
This commit is contained in:
@@ -522,6 +522,20 @@ describe('filters/array', function () {
|
||||
- Garlic press
|
||||
`)
|
||||
})
|
||||
it('should be aware context', function () {
|
||||
const tpl = `{% assign kitchen_products = products | where_exp: "item", "item.type == target" %}
|
||||
Kitchen products:
|
||||
{% for product in kitchen_products -%}
|
||||
- {{ product.title }}
|
||||
{% endfor %}`
|
||||
const scope = { products, target: 'kitchen' }
|
||||
const html = `
|
||||
Kitchen products:
|
||||
- Spatula
|
||||
- Garlic press
|
||||
`
|
||||
return test(tpl, scope, html)
|
||||
})
|
||||
})
|
||||
describe('group_by', function () {
|
||||
const members = [
|
||||
|
||||
Reference in New Issue
Block a user