diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-28 12:54:52 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-28 12:54:52 +0100 |
commit | de8852a76072aa36f95da11994b060a233d558df (patch) | |
tree | 6a76a3399d2994d18482084a45bfad69b4dea148 /core/js/tests | |
parent | 295de6aad7f4ae1636d10466a688f69d6ea5307c (diff) | |
parent | 1473e156f4c1f6c634cc7933343de0fbcc91cbe8 (diff) | |
download | nextcloud-server-de8852a76072aa36f95da11994b060a233d558df.tar.gz nextcloud-server-de8852a76072aa36f95da11994b060a233d558df.zip |
Merge pull request #21958 from owncloud/systemtags-style
Use boxes for system tags, shorten permission text
Diffstat (limited to 'core/js/tests')
-rw-r--r-- | core/js/tests/specs/systemtags/systemtagsSpec.js | 26 | ||||
-rw-r--r-- | core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js | 6 |
2 files changed, 25 insertions, 7 deletions
diff --git a/core/js/tests/specs/systemtags/systemtagsSpec.js b/core/js/tests/specs/systemtags/systemtagsSpec.js index 2e8390ad9f0..515b75258a0 100644 --- a/core/js/tests/specs/systemtags/systemtagsSpec.js +++ b/core/js/tests/specs/systemtags/systemtagsSpec.js @@ -34,7 +34,7 @@ describe('OC.SystemTags tests', function() { userVisible: true }); var $return = OC.SystemTags.getDescriptiveTag(tag); - expect($return.text()).toEqual('Twenty Three (visible, assignable)'); + expect($return.text()).toEqual('Twenty Three'); expect($return.hasClass('non-existing-tag')).toEqual(false); }); @@ -42,10 +42,28 @@ describe('OC.SystemTags tests', function() { var $return = OC.SystemTags.getDescriptiveTag({ id: 42, name: 'Fourty Two', - userAssignable: false, - userVisible: false + userAssignable: true, + userVisible: true }); - expect($return.text()).toEqual('Fourty Two (invisible, not assignable)'); + expect($return.text()).toEqual('Fourty Two'); expect($return.hasClass('non-existing-tag')).toEqual(false); }); + + it('scope', function() { + function testScope(userVisible, userAssignable, expectedText) { + var $return = OC.SystemTags.getDescriptiveTag({ + id: 42, + name: 'Fourty Two', + userAssignable: userAssignable, + userVisible: userVisible + }); + expect($return.text()).toEqual(expectedText); + expect($return.hasClass('non-existing-tag')).toEqual(false); + } + + testScope(true, true, 'Fourty Two'); + testScope(false, true, 'Fourty Two (invisible)'); + testScope(false, false, 'Fourty Two (invisible)'); + testScope(true, false, 'Fourty Two (not assignable)'); + }); }); diff --git a/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js b/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js index 0ad383860bc..08470fbdd8a 100644 --- a/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js +++ b/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js @@ -293,12 +293,12 @@ describe('OC.SystemTags.SystemTagsInputField tests', function() { it('formatResult renders tag name with visibility', function() { var opts = select2Stub.getCall(0).args[0]; var $el = $(opts.formatResult({id: '1', name: 'test', userVisible: false, userAssignable: false})); - expect($el.find('.label').text()).toEqual('test (invisible, not assignable)'); + expect($el.find('.label').text()).toEqual('test (invisible)'); }); it('formatSelection renders tag name with visibility', function() { var opts = select2Stub.getCall(0).args[0]; var $el = $(opts.formatSelection({id: '1', name: 'test', userVisible: false, userAssignable: false})); - expect($el.text().trim()).toEqual('test (invisible, not assignable),'); + expect($el.text().trim()).toEqual('test (invisible)'); }); describe('initSelection', function() { var fetchStub; @@ -396,7 +396,7 @@ describe('OC.SystemTags.SystemTagsInputField tests', function() { it('formatSelection renders tag name only', function() { var opts = select2Stub.getCall(0).args[0]; var $el = $(opts.formatSelection({id: '1', name: 'test'})); - expect($el.text().trim()).toEqual('test,'); + expect($el.text().trim()).toEqual('test'); }); describe('initSelection', function() { var fetchStub; |