summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2017-04-20 14:59:08 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-26 13:51:44 +0200
commit3f36548a6d7c67857bf8fed1de7a81828e4c14a3 (patch)
tree57c8b8a180049376d93006147782f3df7dff26b3 /apps/files/tests
parent5b5c3a1773dab4960d41aafc4150859a308311b7 (diff)
downloadnextcloud-server-3f36548a6d7c67857bf8fed1de7a81828e4c14a3.tar.gz
nextcloud-server-3f36548a6d7c67857bf8fed1de7a81828e4c14a3.zip
Reload file list when leaving hidden state
Whenever a file list is already initialized and was hidden when switching to another file list in the navigation bar, if the user comes back to this list it gets redisplayed. At this point the list needs to be refreshed to be able to reflect any potential file changes done from the other lists.
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index ee73914f166..934aa054fb6 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1507,6 +1507,12 @@ describe('OCA.Files.FileList tests', function() {
$('#app-content-files').trigger(new $.Event('urlChanged', {view: 'files', dir: '/somedir'}));
expect(fileList.getCurrentDirectory()).toEqual('/somedir');
});
+ it('reloads the list when leaving hidden state', function() {
+ var reloadStub = sinon.stub(fileList, 'reload');
+ $('#app-content-files').trigger(new $.Event('show'));
+ expect(reloadStub.calledOnce).toEqual(true);
+ reloadStub.restore();
+ });
it('refreshes breadcrumb after update', function() {
var setDirSpy = sinon.spy(fileList.breadcrumb, 'setDirectory');
fileList.changeDirectory('/anothersubdir');