mirror of
https://github.com/nextcloud/server.git
synced 2024-09-13 15:48:32 +02:00
Add unit test for file update
This commit is contained in:
parent
86735c6b5a
commit
665d7b25b0
@ -812,6 +812,22 @@ describe('OCA.Files.FileList tests', function() {
|
||||
.toEqual(OC.imagePath('core', 'filetypes/text.svg'));
|
||||
});
|
||||
});
|
||||
describe('Update file', function() {
|
||||
it('does not change summary', function() {
|
||||
var $summary = $('#filestable .summary');
|
||||
var fileData = new FileInfo({
|
||||
type: 'file',
|
||||
name: 'test file',
|
||||
});
|
||||
var $tr = fileList.add(fileData);
|
||||
|
||||
expect($summary.find('.info').text()).toEqual('0 folders and 1 file');
|
||||
|
||||
var model = fileList.getModelForFile('test file');
|
||||
model.set({size: '100'});
|
||||
expect($summary.find('.info').text()).toEqual('0 folders and 1 file');
|
||||
});
|
||||
})
|
||||
describe('List rendering', function() {
|
||||
it('renders a list of files using add()', function() {
|
||||
expect(fileList.files.length).toEqual(0);
|
||||
|
Loading…
Reference in New Issue
Block a user