[FIX] unskip tests

This commit is contained in:
Géry Debongnie
2021-11-13 17:10:06 +01:00
committed by Aaron Bohy
parent 1658d15b87
commit 1f6e84d141
6 changed files with 167 additions and 86 deletions
+54
View File
@@ -51,4 +51,58 @@ describe("t-props", () => {
await nextTick();
expect(fixture.textContent).toBe("second");
});
test("basic use", async () => {
expect.assertions(5);
let props = { a: 1, b: 2 };
class Child extends Component {
static template = xml`
<span>
<t t-esc="props.a + props.b"/>
</span>
`;
setup() {
expect(this.props).toEqual({ a: 1, b: 2 });
expect(this.props).toBe(props);
}
}
class Parent extends Component {
static template = xml`
<div>
<Child t-props="some.obj"/>
</div>
`;
static components = { Child };
some = { obj: props };
}
await mount(Parent, fixture);
expect(fixture.innerHTML).toBe("<div><span>3</span></div>");
});
test("t-props with props", async () => {
expect.assertions(3); // 2 comes from snapshots
class Child extends Component {
static template = xml`<div />`;
setup() {
expect(this.props).toEqual({ a: 1, b: 2, c: "c" });
}
}
class Parent extends Component {
static template = xml`
<div>
<Child t-props="props" a="1" b="2" />
</div>
`;
static components = { Child };
props = { a: "a", c: "c" };
}
await mount(Parent, fixture);
});
});