diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-01-12 20:27:52 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-01-12 20:27:52 +0100 |
commit | fed572ad28939060ac4d039001639e40240a5d3a (patch) | |
tree | 05df09822687b04887ec9537871b1471fc623b4e /static/jcal-tests.js | |
parent | Minor commentns. (diff) | |
download | calp-fed572ad28939060ac4d039001639e40240a5d3a.tar.gz calp-fed572ad28939060ac4d039001639e40240a5d3a.tar.xz |
jcal_to_xcal now works.
Diffstat (limited to 'static/jcal-tests.js')
-rw-r--r-- | static/jcal-tests.js | 32 |
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> +*/ |