mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] blockdom: fix VHtml patching not setting its html correctly
This commit is contained in:
committed by
Aaron Bohy
parent
753d82149e
commit
1e8576ad40
@@ -1006,4 +1006,31 @@ describe("t-out in components", () => {
|
||||
"<div><b>one</b><b>one</b><b>two</b><b>two</b><b>tree</b><b>tree</b></div>"
|
||||
);
|
||||
});
|
||||
|
||||
test("can switch the contents of two t-out repeatedly", async () => {
|
||||
class Test extends Component {
|
||||
static template = xml`
|
||||
<t t-out="state.a"/>
|
||||
<t t-out="state.b"/>
|
||||
`;
|
||||
state = useState({
|
||||
a: markup("<div>1</div>"),
|
||||
b: markup("<div>2</div>"),
|
||||
});
|
||||
|
||||
reverse() {
|
||||
const { state } = this;
|
||||
[state.a, state.b] = [state.b, state.a];
|
||||
}
|
||||
}
|
||||
|
||||
const comp = await mount(Test, fixture);
|
||||
expect(fixture.innerHTML).toBe("<div>1</div><div>2</div>");
|
||||
comp.reverse();
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("<div>2</div><div>1</div>");
|
||||
comp.reverse();
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("<div>1</div><div>2</div>");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user