From e03362d94265e1d490b1a14fd515e7d16e5c876d Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Thu, 20 Apr 2017 13:54:08 -0600 Subject: [PATCH] Added tests for using hyphens with @ tags --- .../components/test-message/marko-tag.json | 5 +++++ .../components/test-message/template.marko | 6 ++++++ .../nested-tag-shorthand-hyphens-repeated/expected.html | 1 + .../nested-tag-shorthand-hyphens-repeated/template.marko | 4 ++++ .../render/nested-tag-shorthand-hyphens-repeated/test.js | 7 +++++++ .../components/test-message/template.marko | 5 +++++ .../render/nested-tag-shorthand-hyphens/expected.html | 1 + .../render/nested-tag-shorthand-hyphens/template.marko | 3 +++ test/autotests/render/nested-tag-shorthand-hyphens/test.js | 7 +++++++ 9 files changed, 39 insertions(+) create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/marko-tag.json create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/template.marko create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens-repeated/expected.html create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens-repeated/template.marko create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens-repeated/test.js create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens/components/test-message/template.marko create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens/expected.html create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens/template.marko create mode 100644 test/autotests/render/nested-tag-shorthand-hyphens/test.js diff --git a/test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/marko-tag.json b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/marko-tag.json new file mode 100644 index 000000000..b606e39ee --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/marko-tag.json @@ -0,0 +1,5 @@ +{ + "@test-items []": { + "@title": "string" + } +} diff --git a/test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/template.marko b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/template.marko new file mode 100644 index 000000000..9c981bf44 --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/components/test-message/template.marko @@ -0,0 +1,6 @@ + diff --git a/test/autotests/render/nested-tag-shorthand-hyphens-repeated/expected.html b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/expected.html new file mode 100644 index 000000000..8c2d9ce4b --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/expected.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/autotests/render/nested-tag-shorthand-hyphens-repeated/template.marko b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/template.marko new file mode 100644 index 000000000..5ad725ad2 --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/template.marko @@ -0,0 +1,4 @@ + + <@test-item title="Item 1 title">Item 1 body + <@test-item title="Item 2 title">Item 2 body + diff --git a/test/autotests/render/nested-tag-shorthand-hyphens-repeated/test.js b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/test.js new file mode 100644 index 000000000..bf8ad099a --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens-repeated/test.js @@ -0,0 +1,7 @@ +exports.templateData = { + header: { + renderBody: function(out) { + out.write('Header content!'); + } + } +}; diff --git a/test/autotests/render/nested-tag-shorthand-hyphens/components/test-message/template.marko b/test/autotests/render/nested-tag-shorthand-hyphens/components/test-message/template.marko new file mode 100644 index 000000000..2925022d5 --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens/components/test-message/template.marko @@ -0,0 +1,5 @@ +
+

+ +

+
diff --git a/test/autotests/render/nested-tag-shorthand-hyphens/expected.html b/test/autotests/render/nested-tag-shorthand-hyphens/expected.html new file mode 100644 index 000000000..d5370a657 --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens/expected.html @@ -0,0 +1 @@ +

My title

diff --git a/test/autotests/render/nested-tag-shorthand-hyphens/template.marko b/test/autotests/render/nested-tag-shorthand-hyphens/template.marko new file mode 100644 index 000000000..95b3a0bde --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens/template.marko @@ -0,0 +1,3 @@ + + <@my-title>My title + diff --git a/test/autotests/render/nested-tag-shorthand-hyphens/test.js b/test/autotests/render/nested-tag-shorthand-hyphens/test.js new file mode 100644 index 000000000..bf8ad099a --- /dev/null +++ b/test/autotests/render/nested-tag-shorthand-hyphens/test.js @@ -0,0 +1,7 @@ +exports.templateData = { + header: { + renderBody: function(out) { + out.write('Header content!'); + } + } +};