summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-03-17 18:14:31 +0100
committerGitHub <noreply@github.com>2021-03-17 18:14:31 +0100
commitf1fefd91dff68382e0675e42acbd02f4bb415eb8 (patch)
treecf944e0fc74307cb00db6a6a830a68f20685ab49 /apps/files_external
parent6867ba8e33c97fedb29377c40414bf0e20eee0c8 (diff)
parent87d39375d80b38295ae3c73fb56f33a4609a0803 (diff)
downloadnextcloud-server-f1fefd91dff68382e0675e42acbd02f4bb415eb8.tar.gz
nextcloud-server-f1fefd91dff68382e0675e42acbd02f4bb415eb8.zip
Merge pull request #26160 from nextcloud/enh/eslint
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/tests/appSpec.js98
1 files changed, 49 insertions, 49 deletions
diff --git a/apps/files_external/tests/appSpec.js b/apps/files_external/tests/appSpec.js
index a834d96e2c0..fa969f289f0 100644
--- a/apps/files_external/tests/appSpec.js
+++ b/apps/files_external/tests/appSpec.js
@@ -20,80 +20,80 @@
*/
describe('OCA.Files_External.App tests', function() {
- var App = OCA.Files_External.App;
- var fileList;
+ const App = OCA.Files_External.App
+ let fileList
beforeEach(function() {
$('#testArea').append(
- '<div id="app-navigation">' +
- '<ul><li data-id="files"><a>Files</a></li>' +
- '<li data-id="sharingin"><a></a></li>' +
- '<li data-id="sharingout"><a></a></li>' +
- '</ul></div>' +
- '<div id="app-content">' +
- '<div id="app-content-files" class="hidden">' +
- '</div>' +
- '<div id="app-content-extstoragemounts" class="hidden">' +
- '</div>' +
- '</div>' +
- '</div>'
- );
- fileList = App.initList($('#app-content-extstoragemounts'));
- });
+ '<div id="app-navigation">'
+ + '<ul><li data-id="files"><a>Files</a></li>'
+ + '<li data-id="sharingin"><a></a></li>'
+ + '<li data-id="sharingout"><a></a></li>'
+ + '</ul></div>'
+ + '<div id="app-content">'
+ + '<div id="app-content-files" class="hidden">'
+ + '</div>'
+ + '<div id="app-content-extstoragemounts" class="hidden">'
+ + '</div>'
+ + '</div>'
+ + '</div>'
+ )
+ fileList = App.initList($('#app-content-extstoragemounts'))
+ })
afterEach(function() {
- App.fileList = null;
- fileList.destroy();
- fileList = null;
- });
+ App.fileList = null
+ fileList.destroy()
+ fileList = null
+ })
describe('initialization', function() {
it('inits external mounts list on show', function() {
- expect(App.fileList).toBeDefined();
- });
- });
+ expect(App.fileList).toBeDefined()
+ })
+ })
describe('file actions', function() {
it('provides default file actions', function() {
- var fileActions = fileList.fileActions;
+ const fileActions = fileList.fileActions
- expect(fileActions.actions.all).toBeDefined();
- expect(fileActions.actions.all.Delete).toBeDefined();
- expect(fileActions.actions.all.Rename).toBeDefined();
- expect(fileActions.actions.all.Download).toBeDefined();
+ expect(fileActions.actions.all).toBeDefined()
+ expect(fileActions.actions.all.Delete).toBeDefined()
+ expect(fileActions.actions.all.Rename).toBeDefined()
+ expect(fileActions.actions.all.Download).toBeDefined()
- expect(fileActions.defaults.dir).toEqual('Open');
- });
+ expect(fileActions.defaults.dir).toEqual('Open')
+ })
it('redirects to files app when opening a directory', function() {
- var oldList = OCA.Files.App.fileList;
+ const oldList = OCA.Files.App.fileList
// dummy new list to make sure it exists
- OCA.Files.App.fileList = new OCA.Files.FileList($('<table><thead></thead><tbody></tbody></table>'));
+ OCA.Files.App.fileList = new OCA.Files.FileList($('<table><thead></thead><tbody></tbody></table>'))
- var setActiveViewStub = sinon.stub(OCA.Files.App, 'setActiveView');
+ const setActiveViewStub = sinon.stub(OCA.Files.App, 'setActiveView')
// create dummy table so we can click the dom
- var $table = '<table><thead></thead><tbody id="fileList"></tbody></table>';
- $('#app-content-extstoragemounts').append($table);
+ const $table = '<table><thead></thead><tbody id="fileList"></tbody></table>'
+ $('#app-content-extstoragemounts').append($table)
- App._inFileList = null;
- fileList = App.initList($('#app-content-extstoragemounts'));
+ App._inFileList = null
+ fileList = App.initList($('#app-content-extstoragemounts'))
fileList.setFiles([{
name: 'testdir',
type: 'dir',
path: '/somewhere/inside/subdir',
counterParts: ['user2'],
- shareOwner: 'user2'
- }]);
+ shareOwner: 'user2',
+ }])
- fileList.findFileEl('testdir').find('td a.name').click();
+ fileList.findFileEl('testdir').find('td a.name').click()
- expect(OCA.Files.App.fileList.getCurrentDirectory()).toEqual('/somewhere/inside/subdir/testdir');
+ expect(OCA.Files.App.fileList.getCurrentDirectory()).toEqual('/somewhere/inside/subdir/testdir')
- expect(setActiveViewStub.calledOnce).toEqual(true);
- expect(setActiveViewStub.calledWith('files')).toEqual(true);
+ expect(setActiveViewStub.calledOnce).toEqual(true)
+ expect(setActiveViewStub.calledWith('files')).toEqual(true)
- setActiveViewStub.restore();
+ setActiveViewStub.restore()
// restore old list
- OCA.Files.App.fileList = oldList;
- });
- });
-});
+ OCA.Files.App.fileList = oldList
+ })
+ })
+})