Adds a test case for the loading symbol in deleted files.
Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
parent
55216e6b95
commit
419d72e0ee
3 changed files with 10 additions and 5 deletions
|
@ -275,8 +275,7 @@
|
|||
if (_.isUndefined(options.detailsViewEnabled) || options.detailsViewEnabled) {
|
||||
this._detailsView = new OCA.Files.DetailsView();
|
||||
this._detailsView.$el.insertBefore(this.$el);
|
||||
// this._detailsView.$el.addClass('disappear');
|
||||
this.showDetailsView('/');
|
||||
this._detailsView.$el.addClass('disappear');
|
||||
}
|
||||
|
||||
this._initFileActions(options.fileActions);
|
||||
|
|
|
@ -94,7 +94,7 @@ describe('OCA.Files.FileList tests', function() {
|
|||
'<input type="checkbox" id="select_all_files" class="select-all checkbox">' +
|
||||
'<a class="name columntitle" data-sort="name"><span>Name</span><span class="sort-indicator"></span></a>' +
|
||||
'<span id="selectedActionsList" class="selectedActions hidden">' +
|
||||
'<a href="" class="actions-selected"><span class="icon icon-more"></span><span>Actions</span></a>' +
|
||||
'<a href class="actions-selected"><span class="icon icon-more"></span><span>Actions</span></a>' +
|
||||
'</th>' +
|
||||
'<th class="hidden column-size"><a class="columntitle" data-sort="size"><span class="sort-indicator"></span></a></th>' +
|
||||
'<th class="hidden column-mtime"><a class="columntitle" data-sort="mtime"><span class="sort-indicator"></span></a></th>' +
|
||||
|
|
|
@ -303,7 +303,9 @@ describe('OCA.Trashbin.FileList tests', function() {
|
|||
});
|
||||
it('Deletes selected files when "Delete" clicked', function() {
|
||||
var request;
|
||||
$('.selectedActions .filesSelectMenu .delete').click();
|
||||
var $deleteLink = $('.selectedActions .filesSelectMenu .delete');
|
||||
$deleteLink.click();
|
||||
expect($deleteLink.find('.icon-loading-small').length).toEqual(1);
|
||||
expect(fakeServer.requests.length).toEqual(1);
|
||||
request = fakeServer.requests[0];
|
||||
expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_trashbin/ajax/delete.php');
|
||||
|
@ -323,6 +325,7 @@ describe('OCA.Trashbin.FileList tests', function() {
|
|||
}
|
||||
})
|
||||
);
|
||||
expect($deleteLink.find('.icon-loading-small').length).toEqual(0);
|
||||
expect(fileList.findFileEl('One.txt.d11111').length).toEqual(0);
|
||||
expect(fileList.findFileEl('Three.pdf.d33333').length).toEqual(0);
|
||||
expect(fileList.findFileEl('somedir.d99999').length).toEqual(0);
|
||||
|
@ -348,7 +351,9 @@ describe('OCA.Trashbin.FileList tests', function() {
|
|||
describe('Restore', function() {
|
||||
it('Restores selected files when "Restore" clicked', function() {
|
||||
var request;
|
||||
$('.selectedActions .filesSelectMenu .restore').click();
|
||||
var $restoreLink = $('.selectedActions .filesSelectMenu .restore');
|
||||
$restoreLink.click();
|
||||
expect($restoreLink.find('.icon-loading-small').length).toEqual(1);
|
||||
expect(fakeServer.requests.length).toEqual(1);
|
||||
request = fakeServer.requests[0];
|
||||
expect(request.url).toEqual(OC.webroot + '/index.php/apps/files_trashbin/ajax/undelete.php');
|
||||
|
@ -368,6 +373,7 @@ describe('OCA.Trashbin.FileList tests', function() {
|
|||
}
|
||||
})
|
||||
);
|
||||
expect($restoreLink.find('.icon-loading-small').length).toEqual(0);
|
||||
expect(fileList.findFileEl('One.txt.d11111').length).toEqual(0);
|
||||
expect(fileList.findFileEl('Three.pdf.d33333').length).toEqual(0);
|
||||
expect(fileList.findFileEl('somedir.d99999').length).toEqual(0);
|
||||
|
|
Loading…
Reference in a new issue