aboutsummaryrefslogtreecommitdiffstats
path: root/test/webcals/templates
diff options
context:
space:
mode:
authorJames Lal <james@lightsofapollo.com>2012-06-27 12:39:28 +0200
committerJames Lal <james@lightsofapollo.com>2012-06-27 12:39:28 +0200
commit24932d09294ab7a80b9c00ff505bc2823f1a65d1 (patch)
treeef9d38d2cb2827a3e710770d673d14e8c36fd881 /test/webcals/templates
parentd74007aca2c501ac2fe56f8c440f01f6f6ceaa1f (diff)
downloadjsCalDAV-24932d09294ab7a80b9c00ff505bc2823f1a65d1.tar.gz
Simple calendar filter (with no actual filtering) based on calendar data
Diffstat (limited to 'test/webcals/templates')
-rw-r--r--test/webcals/templates/calendar_filter_test.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/webcals/templates/calendar_filter_test.js b/test/webcals/templates/calendar_filter_test.js
new file mode 100644
index 0000000..517e78a
--- /dev/null
+++ b/test/webcals/templates/calendar_filter_test.js
@@ -0,0 +1,55 @@
+requireRequest();
+requireLib('templates/calendar_data');
+
+suite('webcals/templates/calendar_data', function() {
+ var CalendarFilter;
+ var Template;
+
+ var subject;
+ var template;
+
+ function filter() {
+ subject.filter('VEVENT', true);
+ }
+
+ suiteSetup(function() {
+ CalendarFilter = Webcals.require('templates/calendar_filter');
+ Template = Webcals.require('template');
+ });
+
+ setup(function() {
+ subject = new CalendarFilter();
+ template = new Template('root');
+ });
+
+ test('initialization', function() {
+ assert.deepEqual(subject.struct, {});
+ });
+
+ suite('#render', function() {
+ var output;
+ var expected;
+
+ expected = [
+ '<N0:filter>',
+ '<N0:comp-filter name="VCALENDAR">',
+ '<N0:comp-filter name="VEVENT" />',
+ '</N0:comp-filter>',
+ '</N0:filter>'
+ ].join('');
+
+ setup(function() {
+ filter();
+ });
+
+ test('output', function() {
+ var output = subject.render(template);
+ console.log();
+ console.log(output)
+ console.log();
+ assert.equal(output, expected);
+ });
+ });
+
+});
+