Skip to content

Commit 8c2853f

Browse files
committed
Add more unit tests
1 parent 12afbb9 commit 8c2853f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/test.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ describe("angularjsx", function () {
1717
it("should convert JSX with quotes", function () {
1818
assert.equal(angularjsx.convert("var x = {template: <div class=\"foo\"></div>}"), "var x = {template: \"<div class=\\\"foo\\\"></div>\"}");
1919
});
20-
it("should ignore non-JSX templates", function () {
20+
it("should ignore non-JSX properties named 'template'", function () {
2121
//TODO: \r\n on Windows only? Test on Linux.
2222
assert.equal(angularjsx.convert("var x = {template: {\n}}"), "var x = {template: {\r\n}}");
2323
});
24-
it("should handle dots in span", function () {
24+
it("should ignore string template", function () {
25+
assert.equal(angularjsx.convert("var x = {template: \"<br/>\"}"), "var x = {template: \"<br/>\"}");
26+
});
27+
it("should handle dots and curly braces in span", function () {
2528
assert.equal(angularjsx.convert("var x = {template: <span>{{a.b}}</span>}"), "var x = {template: \"<span>{{a.b}}</span>\"}");
2629
});
30+
it("should handle parentheses", function () {
31+
assert.equal(angularjsx.convert("var x = {template: (<br/>)}"), "var x = {template: (\"<br/>\")}");
32+
});
2733
});

0 commit comments

Comments
 (0)