summaryrefslogtreecommitdiffstats
path: root/test/jquery-ui-timepicker-addon_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/jquery-ui-timepicker-addon_spec.js')
-rw-r--r--test/jquery-ui-timepicker-addon_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/jquery-ui-timepicker-addon_spec.js b/test/jquery-ui-timepicker-addon_spec.js
index 3eb2da5..7efc023 100644
--- a/test/jquery-ui-timepicker-addon_spec.js
+++ b/test/jquery-ui-timepicker-addon_spec.js
@@ -265,5 +265,28 @@ describe('datetimepicker', function() {
expect($.timepicker.timezoneOffsetString(840, true)).toBe('+14:00');
});
});
+
+ describe('log', function() {
+ it('calls console.log with the message if the console exists', function() {
+ var expectedMessage = "Just what I expected!";
+ spyOn(window.console, "log");
+
+ $.timepicker.log(expectedMessage);
+
+ expect(window.console.log).toHaveBeenCalledWith(expectedMessage);
+ });
+
+ it('does not call console.log if there is no console', function() {
+ var originalConsole = window.console,
+ consoleLogSpy = spyOn(window.console, "log");
+ window.console = undefined;
+
+ $.timepicker.log("Don't care");
+
+ expect(consoleLogSpy).not.toHaveBeenCalled();
+
+ window.console = originalConsole;
+ });
+ });
});
}); \ No newline at end of file