summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-02-02 10:42:35 +0100
committerVincent Petry <pvince81@owncloud.com>2016-02-02 10:42:35 +0100
commit22be3867f132537de16a88d15c2d286604f89593 (patch)
treee1d304c3ed9f799061431c8c75fa16a5ac2b8843 /core/js/tests
parent9861a7f6ccde73ad551a1d75b36baed3f9edf530 (diff)
downloadnextcloud-server-22be3867f132537de16a88d15c2d286604f89593.tar.gz
nextcloud-server-22be3867f132537de16a88d15c2d286604f89593.zip
Allow creating tags where another one with same prefix exists
When creating a new entry, compare the full tag name and not only the prefix.
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js b/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js
index 08470fbdd8a..4e47e093f33 100644
--- a/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js
+++ b/core/js/tests/specs/systemtags/systemtagsinputfieldSpec.js
@@ -83,6 +83,15 @@ describe('OC.SystemTags.SystemTagsInputField tests', function() {
expect(result.userVisible).toEqual(true);
expect(result.userAssignable).toEqual(true);
});
+ it('creates dummy tag when user types non-matching name even with prefix of existing tag', function() {
+ var opts = select2Stub.getCall(0).args[0];
+ var result = opts.createSearchChoice('ab');
+ expect(result.id).toEqual(-1);
+ expect(result.name).toEqual('ab');
+ expect(result.isNew).toEqual(true);
+ expect(result.userVisible).toEqual(true);
+ expect(result.userAssignable).toEqual(true);
+ });
it('creates the real tag and fires select event after user selects the dummy tag', function() {
var selectHandler = sinon.stub();
view.on('select', selectHandler);