summaryrefslogtreecommitdiffstats
path: root/core/js/tests/specs/shareSpec.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-08-15 16:19:50 +0200
committerVincent Petry <pvince81@owncloud.com>2014-08-15 16:19:50 +0200
commit607ea636be4a5a48b6abec8df3eaefe20fe4a1ba (patch)
tree920c1e3c7838e4dfbee8c6a8098832e05445d421 /core/js/tests/specs/shareSpec.js
parent1fff77f5de6f0cd3810a23f5b666452a5769bb1c (diff)
downloadnextcloud-server-607ea636be4a5a48b6abec8df3eaefe20fe4a1ba.tar.gz
nextcloud-server-607ea636be4a5a48b6abec8df3eaefe20fe4a1ba.zip
Fixed folder icon update routine when share owner exists
Whenever a folder has a "data-share-owner" attribute, the icon is now properly updated to a shared folder icon.
Diffstat (limited to 'core/js/tests/specs/shareSpec.js')
-rw-r--r--core/js/tests/specs/shareSpec.js47
1 files changed, 46 insertions, 1 deletions
diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index 893f816833b..1fd36dfff04 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -562,7 +562,52 @@ describe('OC.Share tests', function() {
});
});
- // TODO: add unit tests for folder icons
+ describe('displaying the folder icon', function() {
+ function checkIcon(expectedImage) {
+ var imageUrl = OC.TestUtil.getImageUrl($file.find('.filename'));
+ expectedIcon = OC.imagePath('core', expectedImage);
+ expect(imageUrl).toEqual(expectedIcon);
+ }
+
+ it('shows a plain folder icon for non-shared folders', function() {
+ $file.attr('data-type', 'dir');
+ OC.Share.markFileAsShared($file);
+
+ checkIcon('filetypes/folder');
+ });
+ it('shows a shared folder icon for folders shared with another user', function() {
+ $file.attr('data-type', 'dir');
+ OC.Share.markFileAsShared($file, true);
+
+ checkIcon('filetypes/folder-shared');
+ });
+ it('shows a shared folder icon for folders shared with the current user', function() {
+ $file.attr('data-type', 'dir');
+ $file.attr('data-share-owner', 'someoneelse');
+ OC.Share.markFileAsShared($file);
+
+ checkIcon('filetypes/folder-shared');
+ });
+ it('shows a link folder icon for folders shared with link', function() {
+ $file.attr('data-type', 'dir');
+ OC.Share.markFileAsShared($file, false, true);
+
+ checkIcon('filetypes/folder-public');
+ });
+ it('shows a link folder icon for folders shared with both link and another user', function() {
+ $file.attr('data-type', 'dir');
+ OC.Share.markFileAsShared($file, true, true);
+
+ checkIcon('filetypes/folder-public');
+ });
+ it('shows a link folder icon for folders reshared with link', function() {
+ $file.attr('data-type', 'dir');
+ $file.attr('data-share-owner', 'someoneelse');
+ OC.Share.markFileAsShared($file, false, true);
+
+ checkIcon('filetypes/folder-public');
+ });
+ });
// TODO: add unit tests for share recipients
});
});