Commit 67ecb410 authored by Chinmay Pendharkar's avatar Chinmay Pendharkar
Browse files

fixed tests for UTC times and fixed UID generation

parent 791bceb1
......@@ -141,7 +141,7 @@ var a = {
}
function _getUID(e) {
return _formatDate(e.start) + 'Z-' + e.uid + '@' + cal.domain;
return _formatDate(e.start) + '-' + e.uid + '@' + cal.domain;
}
// VCALENDAR and VERSION
......
......@@ -3,9 +3,9 @@ VERSION:2.0
PRODID:-//sebbo.net//ical-generator.tests//EN
BEGIN:VEVENT
UID:20131004T223930Z-123@sebbo.net
DTSTAMP:20131004T233453
DTSTART:20131004T223930
DTEND:20131004T231500
DTSTAMP:20131004T233453Z
DTSTART:20131004T223930Z
DTEND:20131004T231500Z
SUMMARY:Simple Event
END:VEVENT
END:VCALENDAR
\ No newline at end of file
......@@ -3,9 +3,9 @@ VERSION:2.0
PRODID:-//sebbo.net//ical-generator.tests//EN
BEGIN:VEVENT
UID:20131004T223930Z-123@sebbo.net
DTSTAMP:20131004T233453
DTSTART:20131004T223930
DTEND:20131004T231500
DTSTAMP:20131004T233453Z
DTSTART:20131004T223930Z
DTEND:20131004T231500Z
SUMMARY:Sample Event
LOCATION:localhost
DESCRIPTION:Lorem ipsum dolor sit amet\, consetetur sadipscing elitr\, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat\, sed diam voluptua.\nbeep boop
......
......@@ -3,9 +3,9 @@ VERSION:2.0
PRODID:-//sebbo.net//ical-generator.tests//EN
BEGIN:VEVENT
UID:20131004T223930Z-123@sebbo.net
DTSTAMP:20131004T233453
DTSTART;VALUE=DATE:20131004
DTEND;VALUE=DATE:20131006
DTSTAMP:20131004T233453Z
DTSTART;VALUE=DATE:20131004Z
DTEND;VALUE=DATE:20131006Z
SUMMARY:Sample Event
ORGANIZER;CN="Sebastian Pekarek":mailto:mail@sebbo.net
URL;VALUE=URI:http://sebbo.net/
......
......@@ -115,7 +115,7 @@ describe('ical-generator', function() {
});
});
describe('addEvent()', function() {
it('should return all public methods', function() {
var generator = require(__dirname + '/../lib/ical-generator.js'),
......@@ -258,9 +258,9 @@ describe('ical-generator', function() {
cal.addEvent({
uid: '123',
start: new Date("Fr Oct 04 2013 22:39:30"),
end: new Date("Fr Oct 04 2013 23:15:00"),
stamp: new Date("Fr Oct 04 2013 23:34:53"),
start: new Date("Fr Oct 04 2013 22:39:30 UTC"),
end: new Date("Fr Oct 04 2013 23:15:00 UTC"),
stamp: new Date("Fr Oct 04 2013 23:34:53 UTC"),
summary: 'Simple Event'
});
......@@ -280,9 +280,9 @@ describe('ical-generator', function() {
cal.addEvent({
uid: '123',
start: new Date("Fr Oct 04 2013 22:39:30"),
end: new Date("Fr Oct 04 2013 23:15:00"),
stamp: new Date("Fr Oct 04 2013 23:34:53"),
start: new Date("Fr Oct 04 2013 22:39:30 UTC"),
end: new Date("Fr Oct 04 2013 23:15:00 UTC"),
stamp: new Date("Fr Oct 04 2013 23:34:53 UTC"),
summary: 'Sample Event',
location: 'localhost',
description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.\nbeep boop'
......@@ -304,10 +304,10 @@ describe('ical-generator', function() {
cal.addEvent({
uid: '123',
start: new Date("Fr Oct 04 2013 22:39:30"),
end: new Date("Fr Oct 06 2013 23:15:00"),
start: new Date("Fr Oct 04 2013 22:39:30 UTC"),
end: new Date("Fr Oct 06 2013 23:15:00 UTC"),
allDay: true,
stamp: new Date("Fr Oct 04 2013 23:34:53"),
stamp: new Date("Fr Oct 04 2013 23:34:53 UTC"),
summary: 'Sample Event',
organizer: {
name: 'Sebastian Pekarek',
......@@ -386,4 +386,4 @@ describe('ical-generator', function() {
assert.equal(cal.length(), 0);
});
});
});
\ No newline at end of file
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment