Commit ab4fbad3 authored by Sebastian Pekarek's avatar Sebastian Pekarek
Browse files

Add unit tests for #11

parent 2f57354a
......@@ -173,10 +173,8 @@ var a = {
g += 'X-WR-CALNAME:' + cal.name + '\n';
}
if (cal.tz) {
if(cal.tz) {
g += 'X-WR-TIMEZONE:' + cal.tz + '\n';
}else{
g += 'X-WR-TIMEZONE:UTC+8\n';
}
// Domain
......
......@@ -51,6 +51,30 @@ describe('ical-generator', function() {
});
describe('setTZ()', function() {
it('should return all public methods', function() {
var generator = require(__dirname + '/../lib/ical-generator.js'),
cal = generator();
assert.deepEqual(cal, cal.setName('test'));
});
it('should change something', function() {
var generator = require(__dirname + '/../lib/ical-generator.js'),
cal = generator();
cal.setTZ('UTC+8');
cal.addEvent({
start: new Date(),
end: new Date(new Date().getTime() + 3600000),
summary: 'Example Event'
});
assert(cal.toString().indexOf('UTC+8') > -1);
});
});
describe('setProdID()', function() {
it('should return all public methods', function() {
var generator = require(__dirname + '/../lib/ical-generator.js'),
......
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