mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
856 lines
23 KiB
Plaintext
856 lines
23 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`attributes changing a class with t-att-class (preexisting class 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['v'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes changing a class with t-att-class 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['v'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes changing an attribute with t-att- 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"value\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['v'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes class and t-att-class should combine together 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\" class=\\"hello\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes class and t-attf-class with ternary operation 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = (ctx['value']?'world':'');
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic attribute evaluating to 0 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic attribute falsy variable 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic attribute with a dash 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"data-action-id\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['id'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic attributes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = 'bar';
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic attributes with backticks 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`bar\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic class attribute 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic class attribute evaluating to 0 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic class attribute that starts and ends with a space 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic class attribute which is only a space 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic class attribute with multiple consecutive spaces 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic empty class attribute 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"aria-label\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`Some text \${ctx['id']}\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic undefined class attribute 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes dynamic undefined generic attribute 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"thing\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['c'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes fixed variable 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes format expression 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = (ctx['value']+37);
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes format literal 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`bar\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes format multiple 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`a \${ctx['value1']} is \${ctx['value2']} of \${ctx['value3']} ]\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes format value 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`b\${ctx['value']}r\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes from object variables set previously 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { isBoundary, withDefault, setContextValue } = helpers;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
|
|
<span block-attribute-0=\\"class\\"/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
ctx = Object.create(ctx);
|
|
ctx[isBoundary] = 1
|
|
const b2 = text(\`
|
|
\`);
|
|
setContextValue(ctx, \\"o\\", {a:'b'});
|
|
let attr1 = ctx['o'].a;
|
|
const b3 = block3([attr1]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes from variables set previously (no external node) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { isBoundary, withDefault, setContextValue } = helpers;
|
|
|
|
let block4 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
ctx = Object.create(ctx);
|
|
ctx[isBoundary] = 1
|
|
const b2 = text(\`
|
|
\`);
|
|
setContextValue(ctx, \\"abc\\", 'def');
|
|
const b3 = text(\`
|
|
\`);
|
|
let attr1 = ctx['abc'];
|
|
const b4 = block4([attr1]);
|
|
return multi([b2, b3, b4]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes from variables set previously 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { isBoundary, withDefault, setContextValue } = helpers;
|
|
|
|
let block1 = createBlock(\`<div><span block-attribute-0=\\"class\\"/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
ctx = Object.create(ctx);
|
|
ctx[isBoundary] = 1
|
|
setContextValue(ctx, \\"abc\\", 'def');
|
|
let attr1 = ctx['abc'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes object 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes static attributes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div foo=\\"a\\" bar=\\"b\\" baz=\\"c\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes static attributes on void elements 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<img src=\\"/test.skip.jpg\\" alt=\\"Test\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes static attributes with backticks 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div foo=\\"\\\\\`bar\\\\\`\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes static attributes with dashes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div aria-label=\\"Close\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes string interpolation, alternate syntax 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`b\${ctx['value']}r\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class and class should combine together 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with multiple classes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {'a b c':ctx['value']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with multiple classes 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {['a b c']:ctx['value']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with multiple classes 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {'a b c':ctx['value']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with multiple classes, some of which are duplicate 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {'a b c':ctx['value'],'a b d':!ctx['value']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with object 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"static\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {a:ctx['b'],c:ctx['d'],e:ctx['f']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with object 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {' a ':ctx['value']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-att-class with object 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {' ':ctx['value']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-attf-class 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`hello\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-attf-class should combine with class 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`world\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-attf-class with multiple classes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`hello \${ctx['word']}\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes t-attf-class with multiple classes separated by multiple spaces 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = \`hello \${ctx['word']}\`;
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes tuple literal 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ['foo','bar'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes tuple variable 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['value'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes two classes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"a b\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes two dynamic attributes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\" block-attribute-1=\\"bar\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = 'bar';
|
|
let attr2 = 'foo';
|
|
return block1([attr1, attr2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes updating classes (with obj notation) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = {'a b':ctx['condition']};
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes various escapes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block3 = createBlock(\`<div foo=\\"<foo\\" block-attribute-0=\\"bar\\" block-attribute-1=\\"baz\\" block-attributes=\\"2\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let attr1 = ctx['bar'];
|
|
let attr2 = \`<\${ctx['baz']}>\`;
|
|
let attr3 = ctx['qux'];
|
|
const b3 = block3([attr1, attr2, attr3]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`attributes various escapes 2 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div> < </div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`special cases for some specific html attributes/properties input of type checkbox with t-att-indeterminate 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"indeterminate\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['v'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`special cases for some specific html attributes/properties input type= checkbox, with t-att-checked 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['flag'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`special cases for some specific html attributes/properties input with t-att-value 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['v'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`special cases for some specific html attributes/properties select with t-att-value 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block3 = createBlock(\`<select block-attribute-0=\\"value\\">
|
|
<option value=\\"potato\\">Potato</option>
|
|
<option value=\\"tomato\\">Tomato</option>
|
|
<option value=\\"onion\\">Onion</option>
|
|
</select>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let attr1 = ctx['value'];
|
|
const b3 = block3([attr1]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`special cases for some specific html attributes/properties textarea with t-att-value 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<textarea block-attribute-0=\\"value\\"/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let attr1 = ctx['v'];
|
|
return block1([attr1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`special cases for some specific html attributes/properties various boolean html attributes 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<input type=\\"checkbox\\" checked=\\"checked\\"/>
|
|
<input checked=\\"checked\\"/>
|
|
<div checked=\\"checked\\"/>
|
|
<div selected=\\"selected\\"/>
|
|
<option selected=\\"selected\\" other=\\"1\\"/>
|
|
<input readonly=\\"readonly\\"/>
|
|
<button disabled=\\"disabled\\"/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
const b3 = block3();
|
|
const b4 = text(\`
|
|
\`);
|
|
return multi([b2, b3, b4]);
|
|
}
|
|
}"
|
|
`;
|