summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2014-08-08 13:58:56 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2014-08-08 13:58:56 +0200
commit76ab097ee277daf597c531b2db254fd84002a6de (patch)
tree7ed1e8bcb04cec8167484c31d4956000dce23c85 /core/js
parent55a17a2b23ab9c720eb26f54db4048af22aa59bb (diff)
downloadnextcloud-server-76ab097ee277daf597c531b2db254fd84002a6de.tar.gz
nextcloud-server-76ab097ee277daf597c531b2db254fd84002a6de.zip
update unit test, min date should be always today + 1
Diffstat (limited to 'core/js')
-rw-r--r--core/js/tests/specs/shareSpec.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index 32fecf82b65..893f816833b 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));
});
});