summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2014-06-02 21:26:43 +0200
committerFrank Karlitschek <frank@owncloud.org>2014-06-02 21:26:43 +0200
commitf12a5248a3ee4fd71ade32580afdf0455fbc6764 (patch)
tree5da750f091d84fe3c15495daca3ce999e90a187b /core/js/tests
parentc88c0b9a13231478c626296d78aac7c1f66d87d9 (diff)
parentfbe42a771f433a01e54f744998593ae4cf07ed82 (diff)
downloadnextcloud-server-f12a5248a3ee4fd71ade32580afdf0455fbc6764.tar.gz
nextcloud-server-f12a5248a3ee4fd71ade32580afdf0455fbc6764.zip
Merge pull request #8820 from owncloud/design-details
Design details
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/coreSpec.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index 47e5ebfed55..b46ece05cb9 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -359,8 +359,10 @@ describe('Core base tests', function() {
var oldMatchMedia;
var $toggle;
var $navigation;
+ var clock;
beforeEach(function() {
+ clock = sinon.useFakeTimers();
oldMatchMedia = OC._matchMedia;
// a separate method was needed because window.matchMedia
// cannot be stubbed due to a bug in PhantomJS:
@@ -376,6 +378,7 @@ describe('Core base tests', function() {
afterEach(function() {
OC._matchMedia = oldMatchMedia;
+ clock.restore();
});
it('Sets up menu toggle in mobile mode', function() {
OC._matchMedia.returns({matches: true});
@@ -413,8 +416,10 @@ describe('Core base tests', function() {
$navigation.hide(); // normally done through media query triggered CSS
expect($navigation.is(':visible')).toEqual(false);
$toggle.click();
+ clock.tick(1 * 1000);
expect($navigation.is(':visible')).toEqual(true);
$toggle.click();
+ clock.tick(1 * 1000);
expect($navigation.is(':visible')).toEqual(false);
});
it('Clicking menu toggle does not toggle navigation in desktop mode', function() {
@@ -448,6 +453,7 @@ describe('Core base tests', function() {
window.initCore();
expect($navigation.is(':visible')).toEqual(false);
$toggle.click();
+ clock.tick(1 * 1000);
expect($navigation.is(':visible')).toEqual(true);
mq.matches = false;
$(window).trigger('resize');
@@ -456,6 +462,7 @@ describe('Core base tests', function() {
$(window).trigger('resize');
expect($navigation.is(':visible')).toEqual(false);
$toggle.click();
+ clock.tick(1 * 1000);
expect($navigation.is(':visible')).toEqual(true);
});
});