2019-06-28 15:48:33 +02:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
|
|
exports[`props validation props are validated in dev mode (code snapshot) 1`] = `
|
2019-12-10 14:27:14 +01:00
|
|
|
"function anonymous(context, extra
|
2019-06-28 15:48:33 +02:00
|
|
|
) {
|
2019-12-10 14:27:14 +01:00
|
|
|
// Template name: \\"App\\"
|
2019-07-14 22:18:00 +02:00
|
|
|
let utils = this.constructor.utils;
|
2019-06-28 15:48:33 +02:00
|
|
|
let QWeb = this.constructor;
|
2019-07-09 16:38:30 +02:00
|
|
|
let parent = context;
|
2019-12-07 22:56:00 +01:00
|
|
|
let scope = Object.create(context);
|
2019-12-12 22:27:52 +01:00
|
|
|
let h = this.h;
|
2019-06-28 15:48:33 +02:00
|
|
|
let c1 = [], p1 = {key:1};
|
2019-12-12 22:27:52 +01:00
|
|
|
let vn1 = h('div', p1, c1);
|
2019-12-12 09:24:07 +01:00
|
|
|
// Component 'Child'
|
|
|
|
|
let w2 = '__3__' in parent.__owl__.cmap ? parent.__owl__.children[parent.__owl__.cmap['__3__']] : false;
|
2019-12-02 15:47:49 +01:00
|
|
|
let props2 = {message:1};
|
|
|
|
|
if (w2 && w2.__owl__.currentFiber && !w2.__owl__.vnode) {
|
|
|
|
|
w2.destroy();
|
|
|
|
|
w2 = false;
|
2019-06-28 15:48:33 +02:00
|
|
|
}
|
2019-12-02 15:47:49 +01:00
|
|
|
if (w2) {
|
2019-12-07 22:56:00 +01:00
|
|
|
w2.__updateProps(props2, extra.fiber, undefined);
|
2019-12-02 15:47:49 +01:00
|
|
|
let pvnode = w2.__owl__.pvnode;
|
2019-10-24 21:20:52 +02:00
|
|
|
c1.push(pvnode);
|
|
|
|
|
} else {
|
2019-12-02 15:47:49 +01:00
|
|
|
let componentKey2 = \`Child\`;
|
2021-05-18 09:04:37 +02:00
|
|
|
let W2 = scope['Child'] || context.constructor.components[componentKey2] || QWeb.components[componentKey2];
|
2019-12-02 15:47:49 +01:00
|
|
|
if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')}
|
|
|
|
|
w2 = new W2(parent, props2);
|
2019-12-12 09:24:07 +01:00
|
|
|
parent.__owl__.cmap['__3__'] = w2.__owl__.id;
|
2019-12-07 22:56:00 +01:00
|
|
|
let fiber = w2.__prepare(extra.fiber, undefined, () => { const vnode = fiber.vnode; pvnode.sel = vnode.sel; });
|
2019-12-12 09:24:07 +01:00
|
|
|
let pvnode = h('dummy', {key: '__3__', hook: {remove() {},destroy(vn) {w2.destroy();}}});
|
2019-10-25 15:45:56 +02:00
|
|
|
c1.push(pvnode);
|
2019-12-02 15:47:49 +01:00
|
|
|
w2.__owl__.pvnode = pvnode;
|
2019-06-28 15:48:33 +02:00
|
|
|
}
|
2019-12-02 15:47:49 +01:00
|
|
|
w2.__owl__.parentLastFiberId = extra.fiber.id;
|
2019-09-12 09:39:15 +02:00
|
|
|
return vn1;
|
2019-06-28 15:48:33 +02:00
|
|
|
}"
|
|
|
|
|
`;
|