Skip to content

Commit 180647f

Browse files
committed
Add test for MJML parsing
1 parent b58b604 commit 180647f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/angular-html-parser/test/index_spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ describe("options", () => {
4848
[html.Text, 'const foo = "</";', 1, ['const foo = "</";']],
4949
]);
5050
});
51+
52+
it("should be able to parse MJML", () => {
53+
const MJML_RAW_TAGS = new Set(["mj-style", "mj-raw"]);
54+
const result = parse('<mj-raw></p></mj-raw>', {
55+
getTagContentType: (tagName) =>
56+
MJML_RAW_TAGS.has(tagName) ? TagContentType.RAW_TEXT : undefined,
57+
});
58+
expect(humanizeDom(result)).toEqual([
59+
[html.Element, "mj-raw", 0],
60+
[html.Text, "</p>", 1, ["</p>"]],
61+
]);
62+
});
5163
});
5264
});
5365

0 commit comments

Comments
 (0)