mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] blockdom: undefined properties are treated as empty strings
This commit is contained in:
committed by
Samuel Degueldre
parent
804ad3c35e
commit
3536f41f00
@@ -30,6 +30,19 @@ describe("t-model directive", () => {
|
||||
expect(fixture.innerHTML).toBe("<div><input><span>test</span></div>");
|
||||
});
|
||||
|
||||
test("t-model on an input with an undefined value", async () => {
|
||||
class SomeComponent extends Component {
|
||||
static template = xml`<input t-model="state.text"/>`;
|
||||
state = useState({ text: undefined });
|
||||
}
|
||||
await mount(SomeComponent, fixture);
|
||||
|
||||
expect(fixture.innerHTML).toBe("<input>");
|
||||
|
||||
const input = fixture.querySelector("input")!;
|
||||
expect(input.value).toBe("");
|
||||
});
|
||||
|
||||
test("basic use, on an input with bracket expression", async () => {
|
||||
class SomeComponent extends Component {
|
||||
static template = xml`
|
||||
|
||||
Reference in New Issue
Block a user