Skip to content
Snippets Groups Projects
Unverified Commit 95e34407 authored by Julius Härtl's avatar Julius Härtl
Browse files

Add tests for edit permission state on file shares


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent 2c990ade
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,37 @@ describe('OC.Share.ShareDialogShareeListView', function () { ...@@ -90,6 +90,37 @@ describe('OC.Share.ShareDialogShareeListView', function () {
}); });
describe('Sets correct initial checkbox state', function () { describe('Sets correct initial checkbox state', function () {
it('marks edit box as unchecked for file shares without edit permissions', function () {
shareModel.set('shares', [{
id: 100,
item_source: 123,
permissions: 1,
share_type: OC.Share.SHARE_TYPE_USER,
share_with: 'user1',
share_with_displayname: 'User One',
uid_owner: oc_current_user,
itemType: 'file'
}]);
listView.render();
expect(listView.$el.find("input[name='edit']").is(':not(:checked)')).toEqual(true);
});
it('marks edit box as checked for file shares', function () {
shareModel.set('shares', [{
id: 100,
item_source: 123,
permissions: 1 | OC.PERMISSION_UPDATE,
share_type: OC.Share.SHARE_TYPE_USER,
share_with: 'user1',
share_with_displayname: 'User One',
uid_owner: oc_current_user,
itemType: 'file'
}]);
listView.render();
expect(listView.$el.find("input[name='edit']").is(':checked')).toEqual(true);
});
it('marks edit box as indeterminate when only some permissions are given', function () { it('marks edit box as indeterminate when only some permissions are given', function () {
shareModel.set('shares', [{ shareModel.set('shares', [{
id: 100, id: 100,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment