// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`animations t-transition, on a simple node 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var c2 = [], p2 = {key:2}; var vn2 = h('span', p2, c2); c1.push(vn2); p2.hook = { create: (_, n) => { this.utils.transitionCreate(n.elm, 'chimay'); }, insert: vn => { this.utils.transitionInsert(vn.elm, 'chimay'); }, remove: (vn, rm) => { this.utils.transitionRemove(vn.elm, 'chimay', rm); }, }; c2.push({text: \`blue\`}); return vn1; }" `; exports[`animations t-transition, on a simple node 2`] = `"blue"`; exports[`attributes dynamic attribute falsy variable 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = context['value']; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes dynamic attribute with a dash 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = context['id']; var c2 = [], p2 = {key:2,attrs:{\\"data-action-id\\": _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes dynamic attributes 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'bar'; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes dynamic formatted attributes with a dash 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = \`Some text \${context['id']}\`; var c2 = [], p2 = {key:2,attrs:{\\"aria-label\\": _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes fixed variable 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = context['value']; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes format expression 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = \`\${context['value'] + 37}\`; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes format literal 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = \`bar\`; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes format multiple 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = \`a \${context['value1']} is \${context['value2']} of \${context['value3']} ]\`; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes format value 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = \`b\${context['value']}r\`; var c2 = [], p2 = {key:2,attrs:{foo: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes from object variables set previously 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = {a: 'b'}; var _3 = _2.a; var c4 = [], p4 = {key:4,attrs:{class: _3}}; var vn4 = h('span', p4, c4); c1.push(vn4); return vn1; }" `; exports[`attributes from variables set previously 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = 'def'; var _3 = _2; var c4 = [], p4 = {key:4,attrs:{class: _3}}; var vn4 = h('span', p4, c4); c1.push(vn4); return vn1; }" `; exports[`attributes object 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = context['value']; var c2 = [], p2 = {key:2,attrs:{}}; if (_1 instanceof Array) { p2.attrs[_1[0]] = _1[1]; } else { for (let key in _1) { p2.attrs[key] = _1[key]; } } var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes static attributes 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'a'; var _2 = 'b'; var _3 = 'c'; var c4 = [], p4 = {key:4,attrs:{foo: _1,bar: _2,baz: _3}}; var vn4 = h('div', p4, c4); return vn4; }" `; exports[`attributes static attributes on void elements 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = '/test.jpg'; var _2 = 'Test'; var c3 = [], p3 = {key:3,attrs:{src: _1,alt: _2}}; var vn3 = h('img', p3, c3); return vn3; }" `; exports[`attributes static attributes with dashes 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'Close'; var c2 = [], p2 = {key:2,attrs:{\\"aria-label\\": _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes t-att-class and class should combine together 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'hello'; var _3 = context['value']; var _2 = 'hello' + (_3 ? ' ' + _3 : ''); var c4 = [], p4 = {key:4,attrs:{class: _2}}; var vn4 = h('div', p4, c4); return vn4; }" `; exports[`attributes t-att-class with object 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'static'; var _3 = this.utils.objectToAttrString({a: context['b'],c: context['d'],e: context['f']}); var _2 = 'static' + (_3 ? ' ' + _3 : ''); var c4 = [], p4 = {key:4,attrs:{class: _2}}; var vn4 = h('div', p4, c4); return vn4; }" `; exports[`attributes t-attf-class should combine with class 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'hello ' + \`world\`; var c2 = [], p2 = {key:2,attrs:{class: _1}}; var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes tuple literal 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = ['foo', 'bar']; var c2 = [], p2 = {key:2,attrs:{}}; if (_1 instanceof Array) { p2.attrs[_1[0]] = _1[1]; } else { for (let key in _1) { p2.attrs[key] = _1[key]; } } var vn2 = h('div', p2, c2); return vn2; }" `; exports[`attributes tuple variable 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = context['value']; var c2 = [], p2 = {key:2,attrs:{}}; if (_1 instanceof Array) { p2.attrs[_1[0]] = _1[1]; } else { for (let key in _1) { p2.attrs[key] = _1[key]; } } var vn2 = h('div', p2, c2); return vn2; }" `; exports[`debugging t-debug 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; debugger; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); if (true) { debugger; var c2 = [], p2 = {key:2}; var vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`hey\`}); } return vn1; }" `; exports[`debugging t-log 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = 42; console.log(_2 + 3) return vn1; }" `; exports[`foreach does not pollute the rendering context 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = [1]; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.item_first = i === 0; context.item_last = i === _3.length - 1; context.item_parity = i % 2 === 0 ? 'even' : 'odd'; context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; var _5 = context['item']; if (_5 || _5 === 0) { c1.push({text: _5}); } } return vn1; }" `; exports[`foreach iterate on items (on a element node) 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = [1, 2]; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.item_first = i === 0; context.item_last = i === _3.length - 1; context.item_parity = i % 2 === 0 ? 'even' : 'odd'; context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; var c5 = [], p5 = {key:context['item']}; var vn5 = h('span', p5, c5); c1.push(vn5); var _6 = context['item']; if (_6 || _6 === 0) { c5.push({text: _6}); } } return vn1; }" `; exports[`foreach iterate on items 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = [3, 2, 1]; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.item_first = i === 0; context.item_last = i === _3.length - 1; context.item_parity = i % 2 === 0 ? 'even' : 'odd'; context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; c1.push({text: \` [\`}); var _5 = context['item_index']; if (_5 || _5 === 0) { c1.push({text: _5}); } c1.push({text: \`: \`}); var _6 = context['item']; if (_6 || _6 === 0) { c1.push({text: _6}); } c1.push({text: \` \`}); var _7 = context['item_value']; if (_7 || _7 === 0) { c1.push({text: _7}); } c1.push({text: \`] \`}); } return vn1; }" `; exports[`foreach iterate, dict param 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = context['value']; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.item_first = i === 0; context.item_last = i === _3.length - 1; context.item_parity = i % 2 === 0 ? 'even' : 'odd'; context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; c1.push({text: \` [\`}); var _5 = context['item_index']; if (_5 || _5 === 0) { c1.push({text: _5}); } c1.push({text: \`: \`}); var _6 = context['item']; if (_6 || _6 === 0) { c1.push({text: _6}); } c1.push({text: \` \`}); var _7 = context['item_value']; if (_7 || _7 === 0) { c1.push({text: _7}); } c1.push({text: \` - \`}); var _8 = context['item_parity']; if (_8 || _8 === 0) { c1.push({text: _8}); } c1.push({text: \`] \`}); } return vn1; }" `; exports[`foreach iterate, integer param 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = 3; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.item_first = i === 0; context.item_last = i === _3.length - 1; context.item_parity = i % 2 === 0 ? 'even' : 'odd'; context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; c1.push({text: \` [\`}); var _5 = context['item_index']; if (_5 || _5 === 0) { c1.push({text: _5}); } c1.push({text: \`: \`}); var _6 = context['item']; if (_6 || _6 === 0) { c1.push({text: _6}); } c1.push({text: \` \`}); var _7 = context['item_value']; if (_7 || _7 === 0) { c1.push({text: _7}); } c1.push({text: \`] \`}); } return vn1; }" `; exports[`foreach iterate, position 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = 5; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.elem_first = i === 0; context.elem_last = i === _3.length - 1; context.elem_parity = i % 2 === 0 ? 'even' : 'odd'; context.elem_index = i; context.elem = _3[i]; context.elem_value = _4[i]; c1.push({text: \` -\`}); if (context['elem_first']) { c1.push({text: \` first\`}); } if (context['elem_last']) { c1.push({text: \` last\`}); } c1.push({text: \` (\`}); var _5 = context['elem_parity']; if (_5 || _5 === 0) { c1.push({text: _5}); } c1.push({text: \`) \`}); } return vn1; }" `; exports[`foreach warn if no key in some case 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = [1, 2]; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.item_first = i === 0; context.item_last = i === _3.length - 1; context.item_parity = i % 2 === 0 ? 'even' : 'odd'; context.item_index = i; context.item = _3[i]; context.item_value = _4[i]; var c5 = [], p5 = {key:5}; var vn5 = h('span', p5, c5); c1.push(vn5); var _6 = context['item']; if (_6 || _6 === 0) { c5.push({text: _6}); } } return vn1; }" `; exports[`loading templates can initialize qweb with a string 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); c1.push({text: \`jupiler\`}); return vn1; }" `; exports[`loading templates can load a few templates from a xml string 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('ul', p1, c1); var c2 = [], p2 = {key:2}; var vn2 = h('li', p2, c2); c1.push(vn2); c2.push({text: \`ok\`}); var c3 = [], p3 = {key:3}; var vn3 = h('li', p3, c3); c1.push(vn3); c3.push({text: \`foo\`}); return vn1; }" `; exports[`misc global 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = [4,5,6]; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.value_first = i === 0; context.value_last = i === _3.length - 1; context.value_parity = i % 2 === 0 ? 'even' : 'odd'; context.value_index = i; context.value = _3[i]; context.value_value = _4[i]; var c5 = [], p5 = {key:5,on:{}}; var vn5 = h('span', p5, c5); c1.push(vn5); var _6 = context['value']; if (_6 || _6 === 0) { c5.push({text: _6}); } { let _11 = 'bbb' var _13 = 'agüero'; var c14 = [], p14 = {key:14,attrs:{\\"falló\\": _13},on:{}}; var vn14 = h('Año', p14, c14); c1.push(vn14); { let _15 = 'aaa' var c16 = [], p16 = {key:16,on:{}}; var vn16 = h('span', p16, c16); c14.push(vn16); if (_15 || _15 === 0) { c16.push({text: _15}); } else { c16.push({text: \`foo default\`}); } } var c17 = [], p17 = {key:17,on:{}}; var vn17 = h('span', p17, c17); c14.push(vn17); var _18 = context['foo']; if (_18 || _18 === 0) { c17.push({text: _18}); } else { c17.push({text: \`foo default\`}); } var _19 = 'bbb'; { let _19 = 'bbb' var c20 = [], p20 = {key:20,on:{}}; var vn20 = h('span', p20, c20); c14.push(vn20); if (_19 || _19 === 0) { c20.push({text: _19}); } else { c20.push({text: \`foo default\`}); } } } } var c21 = [], p21 = {key:21,on:{}}; var vn21 = h('div', p21, c21); c1.push(vn21); var _22 = context['toto']; if (_22 || _22 === 0) { var frag23 = this.utils.getFragment(_22) var p24 = {hook: { insert: n => n.elm.parentNode.replaceChild(frag23, n.elm), }}; var vn24 = h('div', p24) c21.push(vn24); } else { c21.push({text: \`toto default\`}); } return vn1; }" `; exports[`special cases for some boolean html attributes/properties input type= checkbox, with t-att-checked 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var _1 = 'checkbox'; var _2 = context['flag']; var c3 = [], p3 = {key:3,attrs:{type: _1,checked: _2},props:{checked: _2}}; var vn3 = h('input', p3, c3); return vn3; }" `; exports[`special cases for some boolean html attributes/properties various boolean html attributes 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = 'checkbox'; var _3 = 'checked'; var c4 = [], p4 = {key:4,attrs:{type: _2,checked: _3},props:{checked: _3}}; var vn4 = h('input', p4, c4); c1.push(vn4); var _5 = 'checked'; var c6 = [], p6 = {key:6,attrs:{checked: _5}}; var vn6 = h('input', p6, c6); c1.push(vn6); var _7 = 'checked'; var c8 = [], p8 = {key:8,attrs:{checked: _7}}; var vn8 = h('div', p8, c8); c1.push(vn8); var _9 = 'selected'; var c10 = [], p10 = {key:10,attrs:{selected: _9}}; var vn10 = h('div', p10, c10); c1.push(vn10); var _11 = 'selected'; var _12 = '1'; var c13 = [], p13 = {key:13,attrs:{selected: _11,other: _12},props:{selected: _11}}; var vn13 = h('option', p13, c13); c1.push(vn13); var _14 = 'readonly'; var c15 = [], p15 = {key:15,attrs:{readonly: _14},props:{readonly: _14}}; var vn15 = h('input', p15, c15); c1.push(vn15); var _16 = 'disabled'; var c17 = [], p17 = {key:17,attrs:{disabled: _16},props:{disabled: _16}}; var vn17 = h('button', p17, c17); c1.push(vn17); return vn1; }" `; exports[`static templates div with a span child node 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var c2 = [], p2 = {key:2}; var vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`word\`}); return vn1; }" `; exports[`static templates div with a text node 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); c1.push({text: \`word\`}); return vn1; }" `; exports[`static templates empty div 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); return vn1; }" `; exports[`static templates simple string 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var vn1 = {text: \`hello vdom\`}; return vn1; }" `; exports[`t-call (template calling basic caller 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); c1.push({text: \`ok\`}); return vn1; }" `; exports[`t-call (template calling inherit context 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var _2 = 1; { let _2 = 1 if (_2 || _2 === 0) { c1.push({text: _2}); } } return vn1; }" `; exports[`t-call (template calling scoped parameters 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); { let _2 = 42 c1.push({text: \`ok\`}); } var _3 = context['foo']; if (_3 || _3 === 0) { c1.push({text: _3}); } return vn1; }" `; exports[`t-call (template calling with unused body 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c2 = [], p2 = {key:2}; var vn2 = h('div', p2, c2); c2.push({text: \`ok\`}); return vn2; }" `; exports[`t-call (template calling with unused setbody 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; { let _1 = 3 var c2 = [], p2 = {key:2}; var vn2 = h('div', p2, c2); c2.push({text: \`ok\`}); } return vn2; }" `; exports[`t-call (template calling with used body 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c2 = [], p2 = {key:2}; var vn2 = h('h1', p2, c2); c2.push({text: \`ok\`}); return vn2; }" `; exports[`t-call (template calling with used set body 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); { let _2 = 'ok' if (_2 || _2 === 0) { c1.push({text: _2}); } } return vn1; }" `; exports[`t-esc escaping on a node 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1,on:{}}; var vn1 = h('span', p1, c1); var _2 = 'ok'; if (_2 || _2 === 0) { c1.push({text: _2}); } return vn1; }" `; exports[`t-esc escaping on a node with a body 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1,on:{}}; var vn1 = h('span', p1, c1); var _2 = 'ok'; if (_2 || _2 === 0) { c1.push({text: _2}); } else { c1.push({text: \`nope\`}); } return vn1; }" `; exports[`t-esc escaping on a node with a body, as a default 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1,on:{}}; var vn1 = h('span', p1, c1); var _2 = context['var']; if (_2 || _2 === 0) { c1.push({text: _2}); } else { c1.push({text: \`nope\`}); } return vn1; }" `; exports[`t-esc literal 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); var _2 = 'ok'; if (_2 || _2 === 0) { c1.push({text: _2}); } return vn1; }" `; exports[`t-esc variable 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); var _2 = context['var']; if (_2 || _2 === 0) { c1.push({text: _2}); } return vn1; }" `; exports[`t-if boolean value condition elif 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); if (context['color'] == 'black') { c1.push({text: \`black pearl\`}); } else if (context['color'] == 'yellow') { c1.push({text: \`yellow submarine\`}); } else if (context['color'] == 'red') { c1.push({text: \`red is dead\`}); } else { c1.push({text: \`beer\`}); } return vn1; }" `; exports[`t-if boolean value condition else 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var c2 = [], p2 = {key:2}; var vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`begin\`}); if (context['condition']) { c1.push({text: \`ok\`}); } else { c1.push({text: \`ok-else\`}); } var c3 = [], p3 = {key:3}; var vn3 = h('span', p3, c3); c1.push(vn3); c3.push({text: \`end\`}); return vn1; }" `; exports[`t-if boolean value condition false else 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); var c2 = [], p2 = {key:2}; var vn2 = h('span', p2, c2); c1.push(vn2); c2.push({text: \`begin\`}); if (context['condition']) { c1.push({text: \`fail\`}); } else { c1.push({text: \`fail-else\`}); } var c3 = [], p3 = {key:3}; var vn3 = h('span', p3, c3); c1.push(vn3); c3.push({text: \`end\`}); return vn1; }" `; exports[`t-if boolean value condition missing 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('span', p1, c1); if (context['condition']) { c1.push({text: \`fail\`}); } return vn1; }" `; exports[`t-if boolean value false condition 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); if (context['condition']) { c1.push({text: \`ok\`}); } return vn1; }" `; exports[`t-if boolean value true condition 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); if (context['condition']) { c1.push({text: \`ok\`}); } return vn1; }" `; exports[`t-if can use some boolean operators in expressions 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('div', p1, c1); if (context['cond1'] && context['cond2']) { c1.push({text: \`and\`}); } if (context['cond1'] && context['cond3']) { c1.push({text: \`nope\`}); } if (context['cond1'] || context['cond3']) { c1.push({text: \`or\`}); } if (context['cond3'] || context['cond4']) { c1.push({text: \`nope\`}); } if (context['m'] > 3) { c1.push({text: \`mgt\`}); } if (context['n'] > 3) { c1.push({text: \`ngt\`}); } if (context['m'] < 3) { c1.push({text: \`mlt\`}); } if (context['n'] < 3) { c1.push({text: \`nlt\`}); } return vn1; }" `; exports[`t-key can use t-key directive on a node 1`] = ` "function anonymous(context,extra ) { var h = this.utils.h; var c1 = [], p1 = {key:context['beer'].id}; var vn1 = h('div', p1, c1); var _2 = context['beer'].name; if (_2 || _2 === 0) { c1.push({text: _2}); } return vn1; }" `; exports[`t-key t-key directive in a list 1`] = ` "function anonymous(context,extra ) { context = Object.create(context); var h = this.utils.h; var c1 = [], p1 = {key:1}; var vn1 = h('ul', p1, c1); var _2 = context['beers']; if (!_2) { throw new Error('QWeb error: Invalid loop expression')} if (typeof _2 === 'number') { _2 = Array.from(Array(_2).keys())} var _3 = _2 instanceof Array ? _2 : Object.keys(_2); var _4 = _2 instanceof Array ? _2 : Object.values(_2); for (let i = 0; i < _3.length; i++) { context.beer_first = i === 0; context.beer_last = i === _3.length - 1; context.beer_parity = i % 2 === 0 ? 'even' : 'odd'; context.beer_index = i; context.beer = _3[i]; context.beer_value = _4[i]; var c5 = [], p5 = {key:context['beer'].id}; var vn5 = h('li', p5, c5); c1.push(vn5); var _6 = context['beer'].name; if (_6 || _6 === 0) { c5.push({text: _6}); } } return vn1; }" `; exports[`t-key t-key directive in a list 2`] = `"