'<div id="emptycontent">Empty content message</div>' +
'</div>'
);
+
+ OC.Plugins.register('OCA.Files.FileList', OCA.Files.TagsPlugin);
});
afterEach(function() {
testFiles = undefined;
share_type: OC.Share.SHARE_TYPE_USER,
share_with: 'user1',
share_with_displayname: 'User One',
+ tags: [OC.TAG_FAVORITE],
mimetype: 'text/plain',
uid_owner: 'user2',
displayname_owner: 'User Two'
expect(fakeServer.requests.length).toEqual(2);
expect(fakeServer.requests[0].url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=true'
+ 'shares?format=json&shared_with_me=true&include_tags=true'
);
expect(fakeServer.requests[1].url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'remote_shares?format=json'
+ 'remote_shares?format=json&include_tags=true'
);
fakeServer.requests[0].respond(
fakeServer.requests[1].respond(
200,
{ 'Content-Type': 'application/json' },
- JSON.stringify(ocsResponseRemote)
+ JSON.stringify(ocsResponseRemote)
);
var $rows = fileList.$el.find('tbody tr');
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).toEqual('User Two');
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/remote.php/webdav/local%20path/local%20name.txt'
expect($tr.attr('data-mtime')).toEqual('22222000');
expect($tr.attr('data-share-owner')).toEqual('user3@foo.bar/');
expect($tr.attr('data-share-id')).toEqual('8');
+ expect($tr.attr('data-favorite')).not.toBeDefined();
+ expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/remote.php/webdav/b.txt'
expect(fakeServer.requests.length).toEqual(2);
expect(fakeServer.requests[0].url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=true'
+ 'shares?format=json&shared_with_me=true&include_tags=true'
);
expect(fakeServer.requests[1].url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'remote_shares?format=json'
+ 'remote_shares?format=json&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).toEqual('User Two');
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/index.php/apps/files' +
expect($tr.attr('data-mtime')).toEqual('22222000');
expect($tr.attr('data-share-owner')).toEqual('user3@foo.bar/');
expect($tr.attr('data-share-id')).toEqual('8');
+ expect($tr.attr('data-favorite')).not.toBeDefined();
+ expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/index.php/apps/files' +
share_type: OC.Share.SHARE_TYPE_USER,
share_with: 'user2',
share_with_displayname: 'User Two',
+ tags: [OC.TAG_FAVORITE],
mimetype: 'text/plain',
uid_owner: 'user1',
displayname_owner: 'User One'
request = fakeServer.requests[0];
expect(request.url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=false'
+ 'shares?format=json&shared_with_me=false&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/remote.php/webdav/local%20path/local%20name.txt'
request = fakeServer.requests[0];
expect(request.url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=false'
+ 'shares?format=json&shared_with_me=false&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/index.php/apps/files' +
token: 'abc',
mimetype: 'text/plain',
uid_owner: 'user1',
- displayname_owner: 'User One'
+ displayname_owner: 'User One',
+ tags: [OC.TAG_FAVORITE]
};
expect(fakeServer.requests.length).toEqual(1);
request = fakeServer.requests[0];
expect(request.url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=false'
+ 'shares?format=json&shared_with_me=false&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-mtime')).toEqual('11111000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
);
token: 'abc',
mimetype: 'text/plain',
uid_owner: 'user1',
- displayname_owner: 'User One'
+ displayname_owner: 'User One',
+ tags: [OC.TAG_FAVORITE],
});
// another share of the same file
ocsResponse.ocs.data.push({
request = fakeServer.requests[0];
expect(request.url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=false'
+ 'shares?format=json&shared_with_me=false&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-mtime')).toEqual('22222000');
expect($tr.attr('data-share-owner')).not.toBeDefined();
expect($tr.attr('data-share-id')).toEqual('7,8,9');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
);
token: 'abc',
mimetype: 'text/plain',
uid_owner: 'user1',
- displayname_owner: 'User One'
+ displayname_owner: 'User One',
+ tags: [OC.TAG_FAVORITE]
},{
id: 8,
item_type: 'file',
share_with_displayname: 'User Two',
mimetype: 'text/plain',
uid_owner: 'user1',
- displayname_owner: 'User One'
+ displayname_owner: 'User One',
+ tags: [OC.TAG_FAVORITE]
});
expect(fakeServer.requests.length).toEqual(1);
request = fakeServer.requests[0];
expect(request.url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=false'
+ 'shares?format=json&shared_with_me=false&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-share-recipients')).not.toBeDefined();
expect($tr.attr('data-share-owner')).not.toBeDefined();
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot + '/remote.php/webdav/local%20path/local%20name.txt'
);
expect($tr.attr('data-id')).toEqual('50');
expect($tr.attr('data-file')).toEqual('local name2.txt');
expect($tr.attr('data-expiration')).not.toEqual('0');
+ expect($tr.attr('data-favorite')).not.toBeDefined();
+ expect($tr.attr('data-tags')).toEqual('');
expect($tr.find('td:last-child span').text()).toEqual('in a day');
});
it('does not show virtual token recipient as recipient when password was set', function() {
request = fakeServer.requests[0];
expect(request.url).toEqual(
OC.linkToOCS('apps/files_sharing/api/v1') +
- 'shares?format=json&shared_with_me=false'
+ 'shares?format=json&shared_with_me=false&include_tags=true'
);
fakeServer.requests[0].respond(
expect($tr.attr('data-share-recipients')).not.toBeDefined();
expect($tr.attr('data-share-owner')).not.toBeDefined();
expect($tr.attr('data-share-id')).toEqual('7');
+ expect($tr.attr('data-favorite')).toEqual('true');
+ expect($tr.attr('data-tags')).toEqual(OC.TAG_FAVORITE);
expect($tr.find('a.name').attr('href')).toEqual(
OC.webroot +
'/remote.php/webdav/local%20path/local%20name.txt');