[Pkg-owncloud-commits] [owncloud] 46/121: update unit test, min date should be always today + 1

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 5c89d9c9eeac97036baf6d7e275f638bba8d4110
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Fri Aug 8 13:58:56 2014 +0200

    update unit test, min date should be always today + 1
---
 core/js/tests/specs/shareSpec.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index 32fecf8..893f816 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -259,6 +259,7 @@ describe('OC.Share tests', function() {
 				var shareData;
 				var shareItem;
 				var clock;
+				var expectedMinDate;
 
 				function showDropDown() {
 					OC.Share.showDropDown(
@@ -274,6 +275,7 @@ describe('OC.Share tests', function() {
 				beforeEach(function() {
 					// pick a fake date
 					clock = sinon.useFakeTimers(new Date(2014, 0, 20, 14, 0, 0).getTime());
+					expectedMinDate = new Date(2014, 0, 21, 14, 0, 0);
 					shareItem = {
 						displayname_owner: 'root',
 						expiration: null,
@@ -358,7 +360,7 @@ describe('OC.Share tests', function() {
 					showDropDown();
 					$('#dropdown [name=linkCheckbox]').click();
 					$('#dropdown [name=expirationCheckbox]').click();
-					expect($.datepicker._defaults.minDate).toEqual(new Date());
+					expect($.datepicker._defaults.minDate).toEqual(expectedMinDate);
 					expect($.datepicker._defaults.maxDate).toEqual(null);
 				});
 				it('limits the date range to X days after share time when enforced', function() {
@@ -367,7 +369,7 @@ describe('OC.Share tests', function() {
 					oc_appconfig.core.defaultExpireDateEnforced = true;
 					showDropDown();
 					$('#dropdown [name=linkCheckbox]').click();
-					expect($.datepicker._defaults.minDate).toEqual(new Date());
+					expect($.datepicker._defaults.minDate).toEqual(expectedMinDate);
 					expect($.datepicker._defaults.maxDate).toEqual(new Date(2014, 0, 27, 0, 0, 0, 0));
 				});
 				it('limits the date range to X days after share time when enforced, even when redisplayed the next days', function() {
@@ -380,7 +382,7 @@ describe('OC.Share tests', function() {
 					oc_appconfig.core.defaultExpireDateEnabled = true;
 					oc_appconfig.core.defaultExpireDateEnforced = true;
 					showDropDown();
-					expect($.datepicker._defaults.minDate).toEqual(new Date());
+					expect($.datepicker._defaults.minDate).toEqual(expectedMinDate);
 					expect($.datepicker._defaults.maxDate).toEqual(new Date(2014, 0, 27, 0, 0, 0, 0));
 				});
 			});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list