mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] tests: remove Widget common class
Bad name, and bad practice to use it. It makes tests less standalone.
This commit is contained in:
@@ -967,7 +967,7 @@ exports[`random stuff/miscellaneous snapshotting compiled code 1`] = `
|
||||
exports[`random stuff/miscellaneous t-on with handler bound to dynamic argument on a t-foreach 1`] = `
|
||||
"function anonymous(context, extra
|
||||
) {
|
||||
// Template name: \\"__template__1\\"
|
||||
// Template name: \\"__template__2\\"
|
||||
let utils = this.constructor.utils;
|
||||
let QWeb = this.constructor;
|
||||
let parent = context;
|
||||
|
||||
+319
-229
File diff suppressed because it is too large
Load Diff
+586
-590
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -1,4 +1,4 @@
|
||||
import { Env } from "../src/component/component";
|
||||
import { Env, Component } from "../src/component/component";
|
||||
import { scheduler } from "../src/component/scheduler";
|
||||
import { EvalContext, QWeb } from "../src/qweb/qweb";
|
||||
import { CompilationContext } from "../src/qweb/compilation_context";
|
||||
@@ -25,6 +25,7 @@ beforeEach(() => {
|
||||
slots = Object.assign({}, QWeb.slots);
|
||||
nextId = QWeb.nextId;
|
||||
TEMPLATES = Object.assign({}, QWeb.TEMPLATES);
|
||||
Component.scheduler.tasks = [];
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -32,6 +33,7 @@ afterEach(() => {
|
||||
QWeb.slots = slots;
|
||||
QWeb.nextId = nextId;
|
||||
QWeb.TEMPLATES = TEMPLATES;
|
||||
Component.scheduler.tasks = [];
|
||||
});
|
||||
|
||||
// helpers
|
||||
|
||||
@@ -318,12 +318,13 @@ describe("t-set", () => {
|
||||
<t t-set="v1" t-value="'after'"/>
|
||||
<t t-set="v3" t-value="true"/>
|
||||
<t t-raw="v2"/>
|
||||
</div>`);
|
||||
</div>`
|
||||
);
|
||||
|
||||
expect(renderToString(qweb, "test")).toBe("<div><span>before</span></div>");
|
||||
});
|
||||
expect(renderToString(qweb, "test")).toBe("<div><span>before</span></div>");
|
||||
});
|
||||
|
||||
test("t-set with t-value (truthy) and body", () => {
|
||||
test("t-set with t-value (truthy) and body", () => {
|
||||
qweb.addTemplate(
|
||||
"test",
|
||||
`<div>
|
||||
@@ -335,10 +336,11 @@ describe("t-set", () => {
|
||||
<t t-set="v1" t-value="'after'"/>
|
||||
<t t-set="v3" t-value="false"/>
|
||||
<t t-raw="v2"/>
|
||||
</div>`);
|
||||
</div>`
|
||||
);
|
||||
|
||||
expect(renderToString(qweb, "test")).toBe("<div>Truthy</div>");
|
||||
});
|
||||
expect(renderToString(qweb, "test")).toBe("<div>Truthy</div>");
|
||||
});
|
||||
});
|
||||
|
||||
describe("t-if", () => {
|
||||
|
||||
Reference in New Issue
Block a user