summaryrefslogtreecommitdiffstats
path: root/apps/files/tests
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <hey@jancborchardt.net>2018-07-20 21:12:40 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-07-24 18:58:35 +0200
commita2ad1b9aa920ce3c07c2a2d1cfb32832a59775b3 (patch)
tree1d092b4441d5682d00a7a7e83b5c2385d344c0a8 /apps/files/tests
parent3e6ac57abe40075133c43fe36e7124920309e087 (diff)
downloadnextcloud-server-a2ad1b9aa920ce3c07c2a2d1cfb32832a59775b3.tar.gz
nextcloud-server-a2ad1b9aa920ce3c07c2a2d1cfb32832a59775b3.zip
Fix ability to open file or folder via keyboard, fix #10008
Before, the file or folder was opened when clicking on the name span, but not when clicking on the link that contains the name; clicking on the link highlighted the file and opened the sidebar, just like clicking on the file size or date. Now clicking on the link opens the file or folder, so the unit tests that tested clicks on the link were changed to test clicking on the file size instead. Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
Diffstat (limited to 'apps/files/tests')
-rw-r--r--apps/files/tests/js/filelistSpec.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index efaf9968def..754d62204c1 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -2429,7 +2429,7 @@ describe('OCA.Files.FileList tests', function() {
);
fileList.fileActions.setDefault('text/plain', 'Test');
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
expect(actionStub.calledOnce).toEqual(true);
expect(updateDetailsViewStub.notCalled).toEqual(true);
updateDetailsViewStub.restore();
@@ -2437,14 +2437,14 @@ describe('OCA.Files.FileList tests', function() {
it('highlights current file when clicked and updates sidebar', function() {
fileList.fileActions.setDefault('text/plain', 'Test');
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
expect($tr.hasClass('highlighted')).toEqual(true);
expect(fileList._detailsView.getFileInfo().id).toEqual(1);
});
it('keeps the last highlighted file when clicking outside', function() {
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
fileList.$el.find('tfoot').click();
@@ -2455,12 +2455,12 @@ describe('OCA.Files.FileList tests', function() {
var $tr = fileList.findFileEl('One.txt');
// select
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
$tr.find('input:checkbox').click();
expect($tr.hasClass('highlighted')).toEqual(false);
// deselect
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
$tr.find('input:checkbox').click();
expect($tr.hasClass('highlighted')).toEqual(false);
@@ -2470,12 +2470,12 @@ describe('OCA.Files.FileList tests', function() {
var $tr = fileList.findFileEl('One.txt');
// select
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
fileList.$el.find('.select-all.checkbox').click();
expect($tr.hasClass('highlighted')).toEqual(false);
// deselect
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
fileList.$el.find('.select-all.checkbox').click();
expect($tr.hasClass('highlighted')).toEqual(false);
@@ -2484,7 +2484,7 @@ describe('OCA.Files.FileList tests', function() {
it('closes sidebar whenever the currently highlighted file was removed from the list', function() {
jQuery.fx.off = true;
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
expect($tr.hasClass('highlighted')).toEqual(true);
expect(fileList._detailsView.getFileInfo().id).toEqual(1);
@@ -2496,7 +2496,7 @@ describe('OCA.Files.FileList tests', function() {
});
it('returns the currently selected model instance when calling getModelForFile', function() {
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
var model1 = fileList.getModelForFile('One.txt');
var model2 = fileList.getModelForFile('One.txt');
@@ -2511,7 +2511,7 @@ describe('OCA.Files.FileList tests', function() {
it('closes the sidebar when switching folders', function() {
jQuery.fx.off = true;
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename>a.name').click();
+ $tr.find('td.filesize').click();
expect($('#app-sidebar').hasClass('disappear')).toEqual(false);
fileList.changeDirectory('/another');
@@ -2560,7 +2560,7 @@ describe('OCA.Files.FileList tests', function() {
// not set.
fileList.fileActions.currentFile = null;
var $tr = fileList.findFileEl('One.txt');
- $tr.find('td.filename a.name').click();
+ $tr.find('td.filesize').click();
expect(detailsActionStub.calledOnce).toEqual(true);
expect(detailsActionStub.getCall(0).args[0]).toEqual('One.txt');
var context = detailsActionStub.getCall(0).args[1];