mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] cleanup: prettier
This commit is contained in:
@@ -281,7 +281,9 @@ QWeb.addDirective({
|
|||||||
|
|
||||||
// Step 4: add the appropriate function call to current component
|
// Step 4: add the appropriate function call to current component
|
||||||
// ------------------------------------------------
|
// ------------------------------------------------
|
||||||
const parentComponent = ctx.rootContext.shouldDefineParent ? `parent` : `utils.getComponent(context)`;
|
const parentComponent = ctx.rootContext.shouldDefineParent
|
||||||
|
? `parent`
|
||||||
|
: `utils.getComponent(context)`;
|
||||||
const key = ctx.generateTemplateKey();
|
const key = ctx.generateTemplateKey();
|
||||||
const parentNode = ctx.parentNode ? `c${ctx.parentNode}` : "result";
|
const parentNode = ctx.parentNode ? `c${ctx.parentNode}` : "result";
|
||||||
const extra = `Object.assign({}, extra, {parentNode: ${parentNode}, parent: ${parentComponent}, key: ${key}})`;
|
const extra = `Object.assign({}, extra, {parentNode: ${parentNode}, parent: ${parentComponent}, key: ${key}})`;
|
||||||
|
|||||||
@@ -1134,19 +1134,21 @@ describe("t-slot directive", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class UsingTcallInSlotted extends Component {
|
class UsingTcallInSlotted extends Component {
|
||||||
tcallTemplate = xml`<div class="slot"><Child/></div>`;
|
tcallTemplate = xml`<div class="slot"><Child/></div>`;
|
||||||
static template = xml`
|
static template = xml`
|
||||||
<div>
|
<div>
|
||||||
<Slotted>
|
<Slotted>
|
||||||
<t t-call="{{ tcallTemplate }}"/>
|
<t t-call="{{ tcallTemplate }}"/>
|
||||||
</Slotted>
|
</Slotted>
|
||||||
</div>`;
|
</div>`;
|
||||||
static components = { Slotted , Child };
|
static components = { Slotted, Child };
|
||||||
}
|
}
|
||||||
|
|
||||||
await mount(UsingTcallInSlotted, {target: fixture});
|
await mount(UsingTcallInSlotted, { target: fixture });
|
||||||
|
|
||||||
expect(child.__owl__.parent).toBeInstanceOf(Slotted);
|
expect(child.__owl__.parent).toBeInstanceOf(Slotted);
|
||||||
expect(fixture.innerHTML).toBe(`<div><div class="slotted"><div class="slot"><div class="child"></div></div></div></div>`);
|
expect(fixture.innerHTML).toBe(
|
||||||
|
`<div><div class="slotted"><div class="slot"><div class="child"></div></div></div></div>`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user