[FIX] compiler: prevent block- attributes and tags

This commit is contained in:
Géry Debongnie
2022-02-16 17:05:10 +01:00
committed by Samuel Degueldre
parent 12b8ce963e
commit 8ec7a6f9bf
3 changed files with 29 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
import { renderToString } from "../helpers";
describe("blacklisted tags and attributes", () => {
test("template with block-text tag", () => {
const template = `<div><block-text-0/>hello</div>`;
expect(() => renderToString(template)).toThrow("Invalid tag name: 'block-text-0'");
});
test("template with block-handler tag", () => {
const template = `<div block-handler-0="click">hello</div>`;
expect(() => renderToString(template)).toThrow("Invalid attribute: 'block-handler-0'");
});
});