mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
ffb3263c79
closes #283
140 lines
4.8 KiB
Plaintext
140 lines
4.8 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`animations t-transition combined with component 1`] = `
|
|
"function anonymous(context,extra
|
|
) {
|
|
let utils = this.constructor.utils;
|
|
let QWeb = this.constructor;
|
|
let parent = context;
|
|
let owner = context;
|
|
let result;
|
|
var h = this.h;
|
|
let c1 = [], p1 = {key:1};
|
|
var vn1 = h('div', p1, c1);
|
|
result = vn1;
|
|
//COMPONENT
|
|
let def3;
|
|
let w4 = 4 in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap[4]] : false;
|
|
let _2_index = c1.length;
|
|
c1.push(null);
|
|
let props4 = {};
|
|
if (w4 && w4.__owl__.renderPromise && !w4.__owl__.vnode) {
|
|
if (utils.shallowEqual(props4, w4.__owl__.renderProps)) {
|
|
def3 = w4.__owl__.renderPromise;
|
|
} else {
|
|
w4.destroy();
|
|
w4 = false;
|
|
}
|
|
}
|
|
if (!w4) {
|
|
let componentKey4 = \`Child\`;
|
|
let W4 = context.constructor.components[componentKey4] || QWeb.components[componentKey4];
|
|
if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')}
|
|
w4 = new W4(parent, props4);
|
|
parent.__owl__.cmap[4] = w4.__owl__.id;
|
|
def3 = w4.__prepare();
|
|
def3 = def3.then(vnode=>{if (w4.__owl__.isDestroyed){return}let pvnode=h(vnode.sel, {key: 4, hook: {insert(vn) {let nvn=w4.__mount(vnode, pvnode.elm);pvnode.elm=nvn.elm;utils.transitionInsert(vn, 'chimay');},remove() {},destroy(vn) {let finalize = () => {
|
|
w4.destroy();
|
|
};
|
|
utils.transitionRemove(vn, 'chimay', finalize);}}});c1[_2_index]=pvnode;w4.__owl__.pvnode = pvnode;});
|
|
} else {
|
|
def3 = def3 || w4.__updateProps(props4, extra.forceUpdate, extra.patchQueue);
|
|
def3 = def3.then(()=>{if (w4.__owl__.isDestroyed) {return};let pvnode=w4.__owl__.pvnode;c1[_2_index]=pvnode;});
|
|
}
|
|
extra.promises.push(def3);
|
|
return result;
|
|
}"
|
|
`;
|
|
|
|
exports[`animations t-transition combined with t-component and t-if 1`] = `
|
|
"function anonymous(context,extra
|
|
) {
|
|
let utils = this.constructor.utils;
|
|
let QWeb = this.constructor;
|
|
let parent = context;
|
|
let owner = context;
|
|
let result;
|
|
var h = this.h;
|
|
let c1 = [], p1 = {key:1};
|
|
var vn1 = h('div', p1, c1);
|
|
result = vn1;
|
|
if (context['state'].display) {
|
|
//COMPONENT
|
|
let def3;
|
|
let w4 = 4 in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap[4]] : false;
|
|
let _2_index = c1.length;
|
|
c1.push(null);
|
|
let props4 = {};
|
|
if (w4 && w4.__owl__.renderPromise && !w4.__owl__.vnode) {
|
|
if (utils.shallowEqual(props4, w4.__owl__.renderProps)) {
|
|
def3 = w4.__owl__.renderPromise;
|
|
} else {
|
|
w4.destroy();
|
|
w4 = false;
|
|
}
|
|
}
|
|
if (!w4) {
|
|
let componentKey4 = \`Child\`;
|
|
let W4 = context.constructor.components[componentKey4] || QWeb.components[componentKey4];
|
|
if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')}
|
|
w4 = new W4(parent, props4);
|
|
parent.__owl__.cmap[4] = w4.__owl__.id;
|
|
def3 = w4.__prepare();
|
|
def3 = def3.then(vnode=>{if (w4.__owl__.isDestroyed){return}let pvnode=h(vnode.sel, {key: 4, hook: {insert(vn) {let nvn=w4.__mount(vnode, pvnode.elm);pvnode.elm=nvn.elm;utils.transitionInsert(vn, 'chimay');},remove() {},destroy(vn) {let finalize = () => {
|
|
w4.destroy();
|
|
};
|
|
utils.transitionRemove(vn, 'chimay', finalize);}}});c1[_2_index]=pvnode;w4.__owl__.pvnode = pvnode;});
|
|
} else {
|
|
def3 = def3 || w4.__updateProps(props4, extra.forceUpdate, extra.patchQueue);
|
|
def3 = def3.then(()=>{if (w4.__owl__.isDestroyed) {return};let pvnode=w4.__owl__.pvnode;c1[_2_index]=pvnode;});
|
|
}
|
|
extra.promises.push(def3);
|
|
}
|
|
return result;
|
|
}"
|
|
`;
|
|
|
|
exports[`animations t-transition with no delay/duration 1`] = `
|
|
"function anonymous(context,extra
|
|
) {
|
|
let utils = this.constructor.utils;
|
|
let result;
|
|
var h = this.h;
|
|
let c1 = [], p1 = {key:1};
|
|
var vn1 = h('span', p1, c1);
|
|
result = vn1;
|
|
p1.hook = {
|
|
insert: vn => {
|
|
utils.transitionInsert(vn, 'jupiler');
|
|
},
|
|
remove: (vn, rm) => {
|
|
utils.transitionRemove(vn, 'jupiler', rm);
|
|
},
|
|
};
|
|
c1.push({text: \`blue\`});
|
|
return result;
|
|
}"
|
|
`;
|
|
|
|
exports[`animations t-transition, on a simple node (insert) 1`] = `
|
|
"function anonymous(context,extra
|
|
) {
|
|
let utils = this.constructor.utils;
|
|
let result;
|
|
var h = this.h;
|
|
let c1 = [], p1 = {key:1};
|
|
var vn1 = h('span', p1, c1);
|
|
result = vn1;
|
|
p1.hook = {
|
|
insert: vn => {
|
|
utils.transitionInsert(vn, 'chimay');
|
|
},
|
|
remove: (vn, rm) => {
|
|
utils.transitionRemove(vn, 'chimay', rm);
|
|
},
|
|
};
|
|
c1.push({text: \`blue\`});
|
|
return result;
|
|
}"
|
|
`;
|