diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js index 140f1c0569a8682150154974c3f76148cfa524e1..3a758cd222ad347ac289a240459dbe148a417c9f 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/common.js @@ -167,6 +167,16 @@ define([ 'jquery', 'openbis', 'underscore', 'test/dtos' ], function($, openbis, }); }.bind(this); + this.createVocabularyTerm = function(facade) { + var c = this; + var creation = new dtos.VocabularyTermCreation(); + creation.setCode(c.generateId("VOCABULARY_TERM")); + creation.setVocabularyId(new c.VocabularyPermId("TEST-VOCABULARY")); + return facade.createVocabularyTerms([ creation ]).then(function(permIds) { + return permIds[0]; + }); + }.bind(this); + this.findSpace = function(facade, id) { var c = this; return facade.mapSpaces([ id ], c.createSpaceFetchOptions()).then(function(spaces) { @@ -257,6 +267,13 @@ define([ 'jquery', 'openbis', 'underscore', 'test/dtos' ], function($, openbis, options.setReason("test reason"); return facade.deleteMaterials([ id ], options); }.bind(this); + + this.deleteVocabularyTerm = function(facade, id) { + var c = this; + var options = new dtos.VocabularyTermDeletionOptions(); + options.setReason("test reason"); + return facade.deleteVocabularyTerms([ id ], options); + }.bind(this); this.getObjectProperty = function(object, propertyName) { var propertyNames = propertyName.split('.'); diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-delete.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-delete.js index 1c01a095cb18d6ab557709169e6a5e82b4dc3e77..527a0b2430c82de03dc5d4b8f893861824d76345 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-delete.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-delete.js @@ -153,6 +153,11 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common' ], function($, _, open var c = new common(assert); testDeleteWithoutTrash(c, c.createMaterial, c.findMaterial, c.deleteMaterial); }); + + QUnit.test("deleteVocabularyTerm()", function(assert) { + var c = new common(assert); + testDeleteWithoutTrash(c, c.createVocabularyTerm, c.findVocabularyTerm, c.deleteVocabularyTerm); + }); } }); diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-map.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-map.js index 4512ad42c8f7a75a68d9756ff6459766723ff7ff..0833b8d1d5da56c76799c19f73e0631d85962283 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-map.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-map.js @@ -269,5 +269,29 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common' ], function($, _, open testMap(c, fCreate, fMap, fMapEmptyFetchOptions, fechOptionsTestConfig); }); + QUnit.test("mapVocabularyTerms()", function(assert) { + var c = new common(assert); + var fo = new c.VocabularyTermFetchOptions(); + var fechOptionsTestConfig = getConfigForFetchOptions(fo); + fechOptionsTestConfig.SortBy = null; + + var fCreate = function(facade) { + return $.when(c.createVocabularyTerm(facade), c.createVocabularyTerm(facade)).then(function(permId1, permId2) { + return [ permId1, permId2 ]; + }); + } + + var fMap = function(facade, permIds) { + testFetchOptionsAssignation(c, fo, fechOptionsTestConfig); + return facade.mapVocabularyTerms(permIds, fo); + } + + var fMapEmptyFetchOptions = function(facade, permIds) { + return facade.mapVocabularyTerms(permIds, new c.VocabularyTermFetchOptions()); + } + + testMap(c, fCreate, fMap, fMapEmptyFetchOptions, fechOptionsTestConfig); + }); + } });