`)).toEqual([{"attributes": {"id": {"value": "\"test-id\"", "isStatic": true}, "class": {"value": "'test-class'", "isStatic": true}, "dynamic": {"value": "true", "isStatic": true}, "local": {"value": "$local", "isStatic": false}, "self": {"value": "\"\"", "isStatic": true}}, "closed": false, "type": "tagOpen", "value": "div"}]);
});
test("lex events", () => {
- expect(lex(`
`)).toEqual([{"attributes": {"id": "\"test-id\"", "class": "'test-class'", dynamic: "true", "@event": "function($event){data.doSomething()}", self: "\"\""}, "closed": false, "type": "tagOpen", "value": "div"}]);
+ expect(lex(`
`)).toEqual([{"attributes": {"id": {"value": "\"test-id\"", "isStatic": true}, "class": {"value": "'test-class'", "isStatic": true}, dynamic: {"value": "true", "isStatic": true}, "@event": {"value": "function($event){data.doSomething()}", "isStatic": false}, self: {"value": "\"\"", "isStatic": true}}, "closed": false, "type": "tagOpen", "value": "div"}]);
});
test("lex comments", () => {
diff --git a/packages/moon/test/compiler/parser.test.js b/packages/moon/test/compiler/parser.test.js
index ef204949..3ff79c36 100644
--- a/packages/moon/test/compiler/parser.test.js
+++ b/packages/moon/test/compiler/parser.test.js
@@ -17,7 +17,10 @@ test("parse text element", () => {
expect(parseTest(`test text`)).toEqual({
"name": "text",
"attributes": {
- "": `"test text"`
+ "": {
+ value: `"test text"`,
+ isStatic: true
+ }
},
"children": []
});
@@ -32,7 +35,7 @@ test("parse nested elements", () => {
`)).toEqual({
"name": "div",
"attributes": {
- "dynamic": "true"
+ "dynamic": {"value": "true", "isStatic": true}
},
"children": [
{
@@ -42,7 +45,7 @@ test("parse nested elements", () => {
{
"name": "text",
"attributes": {
- "": "\"Title\""
+ "": {"value": "\"Title\"", "isStatic": true}
},
"children": []
}
@@ -51,13 +54,13 @@ test("parse nested elements", () => {
{
"name": "p",
"attributes": {
- "color": "\"blue\""
+ "color": {"value": "\"blue\"", "isStatic": true}
},
"children": [
{
"name": "text",
"attributes": {
- "": "\"Text\""
+ "": {"value": "\"Text\"", "isStatic": true}
},
"children": []
}