Add unit test for file update

This commit is contained in:
Roeland Jago Douma 2016-01-09 22:47:26 +01:00
parent 86735c6b5a
commit 665d7b25b0
1 changed files with 16 additions and 0 deletions

View File

@ -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);