diff options
author | noveens <noveen.sachdeva@research.iiit.ac.in> | 2017-03-01 17:27:48 +0530 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-02 21:43:44 -0600 |
commit | 93f9db4d59ec7795fe998d45ae8b49f3581231c0 (patch) | |
tree | a760aae2cff3b4b9f37ba441b96797939c73a069 /apps/files/tests | |
parent | 53195b156c68082f1e02e45ba2a266c15ef1bcaa (diff) | |
download | nextcloud-server-93f9db4d59ec7795fe998d45ae8b49f3581231c0.tar.gz nextcloud-server-93f9db4d59ec7795fe998d45ae8b49f3581231c0.zip |
filelist only refreshed if directory changes
check introduced at another method
comment added to explain one check
comment added to explain one check
unit tests added
small fixes in unit tests
missing semicolon added
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files/tests')
-rw-r--r-- | apps/files/tests/js/filelistSpec.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js index c5a75be7c62..f3c04c48cb3 100644 --- a/apps/files/tests/js/filelistSpec.js +++ b/apps/files/tests/js/filelistSpec.js @@ -3005,4 +3005,22 @@ describe('OCA.Files.FileList tests', function() { testMountType(123, 'external-root', 'external', 'external'); }); }); + describe('file list should not refresh if url does not change', function() { + var fileListStub; + + beforeEach(function() { + fileListStub = sinon.stub(OCA.Files.FileList.prototype, 'changeDirectory'); + }); + afterEach(function() { + fileListStub.restore(); + }); + it('File list must not be refreshed', function() { + $('#app-content-files').trigger(new $.Event('urlChanged', {dir: '/subdir'})); + expect(fileListStub.notCalled).toEqual(true); + }); + it('File list must be refreshed', function() { + $('#app-content-files').trigger(new $.Event('urlChanged', {dir: '/'})); + expect(fileListStub.notCalled).toEqual(false); + }); + }); }); |