Skip to content
Snippets Groups Projects
Commit a6b5cd83 authored by vkovtun's avatar vkovtun
Browse files

SSDM-13926: Fixing the failing JS test.

parent b9556417
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -15,7 +15,7 @@
require.paths["test/qunit-report"] = testPath + "/lib/qunit/js/qunit-reporter-junit";
require.paths["test/naturalsort"] = testPath + "/lib/naturalsort/js/naturalSort";
require.urlArgs = 'now=' + Date.now();
// require.urlArgs = 'now=' + Date.now();
require.shim["test/qunit-report"] = {
deps : [ 'test/qunit' ]
......
......@@ -220,6 +220,9 @@ define([ 'jquery', 'openbis', 'underscore', 'test/dtos' ], function($, defaultOp
this.PluginUpdate = dtos.PluginUpdate;
this.WebAppSettings = dtos.WebAppSettings;
this.VocabularyDeletionOptions = dtos.VocabularyDeletionOptions;
this.VocabularyTermDeletionOptions = dtos.VocabularyTermDeletionOptions;
// operations
this.GetSessionInformationOperation = dtos.GetSessionInformationOperation;
......
......@@ -110,15 +110,22 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', '
var fCheck = function(facade) {
var criteria = new c.VocabularySearchCriteria();
criteria.withCode().thatEquals("VOCAB");
facade.searchVocabularies(criteria, c.createVocabularyFetchOptions()).then(function(results) {
c.assertEqual(results.getTotalCount(), 3)
var objects = results.getObjects();
criteria.withTerms();
return facade.searchVocabularies(criteria, c.createVocabularyFetchOptions()).then(function(results) {
c.assertEqual(results.getTotalCount(), 1)
var vocabulary = (results.getObjects())[0];
var codes = objects.map(function(object) {
c.assertEqual(vocabulary.code, "VOCAB");
var terms = vocabulary.getTerms();
c.assertEqual(terms.length, 3)
var codes = terms.map(function(object) {
return object.code;
}).sort();
var labels = objects.map(function(object) {
var labels = terms.map(function(object) {
return object.label;
}).sort();
......@@ -129,6 +136,14 @@ define([ 'jquery', 'underscore', 'openbis', 'test/openbis-execute-operations', '
c.assertEqual(labels[0], "A");
c.assertEqual(labels[1], "B");
c.assertEqual(labels[2], "C");
// var options = new c.VocabularyTermDeletionOptions();
// options.setReason("test reason");
// facade.deleteVocabularyTerms([ "TERM_A", "TERM_B", "TERM_C" ], options);
//
// var options = new c.VocabularyDeletionOptions();
// options.setReason("test reason");
// facade.deleteVocabularies([ "VOCAB" ], options);
}).fail(function(error) {
c.fail("Error searching vocabularies. error=" + error.message);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment