can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r12124: LJSUP-12531: Repost: Error: Not able to ...

Committer: dpetrov
LJSUP-12531: Repost: Error: Not able to create new entry. Add tests to verify, that error is fixed.
U   trunk/htdocs/js/test/basic.js
Modified: trunk/htdocs/js/test/basic.js
===================================================================
--- trunk/htdocs/js/test/basic.js	2012-06-15 14:58:26 UTC (rev 12123)
+++ trunk/htdocs/js/test/basic.js	2012-06-18 08:36:35 UTC (rev 12124)
@@ -100,3 +100,36 @@
 	equal( '__galadriel__', link.journal );
 	equal( undefined, link.ditemid );
 });
+
+
+module('LJ.Util.Date');
+
+test('pozitive timezone', function() {
+	var _protoDate = window.Date;
+
+	window.Date = function() {
+		this.getTimezoneOffset = function() {
+			return -240; // +0400
+		}
+	};
+
+	window.Date.prototype = _protoDate;
+
+	equal(LJ.Util.Date.timezone(), '+0400');
+	window.Date = _protoDate;
+});
+
+test('negative timezone', function() {
+	var _protoDate = window.Date;
+
+	window.Date = function() {
+		this.getTimezoneOffset = function() {
+			return 240; // -0400
+		}
+	};
+
+	window.Date.prototype = _protoDate;
+
+	equal(LJ.Util.Date.timezone(), '-0400');
+	window.Date = _protoDate;
+});

Tags: can3p, dpetrov, js, ljcom
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments