aboutsummaryrefslogtreecommitdiff
path: root/static/jcal-tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/jcal-tests.js')
-rw-r--r--static/jcal-tests.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/static/jcal-tests.js b/static/jcal-tests.js
new file mode 100644
index 00000000..c84d9bd1
--- /dev/null
+++ b/static/jcal-tests.js
@@ -0,0 +1,32 @@
+/* "Test cases" for jcal.js.
+ ideally we would actually have runnable tests, but
+ `document' is only available in the browser.
+*/
+
+let doc = document.implementation.createDocument(xcal, 'icalendar');
+
+jcal = ['key', {}, 'text', 'value'];
+
+jcal_property_to_xcal_property(doc, jcal);
+
+
+
+jcal_to_xcal(['vcalendar', [], [['vevent', [['key', {}, 'text', 'value']], []]]]).childNodes[0].outerHTML
+
+/* returns (except not pretty printee)
+<icalendar xmlns="urn:ietf:params:xml:ns:icalendar-2.0">
+ <vcalendar>
+ <properties/>
+ <components>
+ <vevent>
+ <properties>
+ <key>
+ <text>value</text>
+ </key>
+ </properties>
+ <components/>
+ </vevent>
+ </components>
+ </vcalendar>
+</icalendar>
+*/