requireRequest();
testSupport.lib('templates/calendar_data');
suite('webcals/templates/calendar_data', function() {
var CalendarData;
var Template;
var subject;
var template;
function select() {
subject.select('VTODO', ['DTIME']);
subject.select('VTODO', ['NAME', { VTIMEZONE: true }]);
subject.select('VEVENT', ['NAME', {
'VALARM': ['NAME']
}]);
}
suiteSetup(function() {
CalendarData = Webcals.require('templates/calendar_data');
Template = Webcals.require('template');
});
setup(function() {
subject = new CalendarData();
template = new Template('root');
});
test('initialization', function() {
assert.deepEqual(subject.struct, {});
});
suite('#render', function() {
var output;
var expected;
expected = [
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
''
].join('');
test('without items', function() {
var output = subject.render(template);
assert.equal(
output,
''
);
});
test('output', function() {
select();
var output = subject.render(template);
assert.equal(output, expected);
});
});
});