allow non alphanumeric dynamic attributes in qweb

This commit is contained in:
Géry Debongnie
2019-02-06 11:27:25 +01:00
parent 7b5610802a
commit e398ee2668
3 changed files with 23 additions and 2 deletions
+6
View File
@@ -309,6 +309,12 @@ describe("attributes", () => {
expect(result).toBe(`<div foo="bar"></div>`);
});
test("dynamic attribute with a dash", () => {
qweb.addTemplate("test", `<div t-att-data-action-id="id"/>`);
const result = renderToString(qweb, "test", { id: 32 });
expect(result).toBe(`<div data-action-id="32"></div>`);
});
test("fixed variable", () => {
qweb.addTemplate("test", `<div t-att-foo="value"/>`);
const result = renderToString(qweb, "test", { value: "ok" });