blob: c84d9bd1385b91fb19f43d8dbf28d2e431ec0b09 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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>
*/
|