Skip to content
Snippets Groups Projects
Commit c231e8b0 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1048996][Alphabetische Sortierung und...

[Projekt: Entwicklung - Neon][TicketNr.: 1048996][Alphabetische Sortierung und manuelle Sortierung über Pfeile von Schlüsselwortlisten]
Bugfixing 5
parent 204b49c7
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,7 @@ KeywordUtils.getCategoryNameById = function(pCategoryId)
/**
* returns the name of a KeywordCategory by the given UUID or "<unknown>" if it does not exist
* returns the UUID of a KeywordCategory by the category name (fromer keyword container) or an empty string "" if it does not exist
*
* @param {String} pName name of the Keyword category (former "keyword container")
*
......
......@@ -37,7 +37,7 @@ var getCategoryNameById = new TestSuite("KeywordUtils.getCategoryNameById", [
function(pTester) {
var actualValue = KeywordUtils.getCategoryNameById("a55654b1-6a19-4d0c-b08d-cfbc12b5f7b1");
pTester.expectThat(actualValue).equals("<unknown>").assert();
pTester.expectThat(actualValue).equals("").assert();
}
),
......@@ -45,11 +45,35 @@ var getCategoryNameById = new TestSuite("KeywordUtils.getCategoryNameById", [
function(pTester) {
var actualValue = KeywordUtils.getCategoryNameById();
pTester.expectThat(actualValue).equals("<unknown>").assert();
pTester.expectThat(actualValue).equals("").assert();
}
),
]);
var getCategoryIdByName = new TestSuite("KeywordUtils.getCategoryIdByName", [
new Test("should return existing keyword uuid for correct category name",
function(pTester) {
var actualValue = KeywordUtils.getCategoryIdByName("MemberRole");
pTester.expectThat(actualValue).equals("b3765719-9d07-41c4-a813-18bc9056db1a").assert();
}
),
new Test("should return empty string for wrong keyword category name",
function(pTester) {
var actualValue = KeywordUtils.getCategoryIdByName("XXXAddressTypesXXX");
pTester.expectThat(actualValue).equals("").assert();
}
),
new Test("should return empty string when not passing a keyword category name",
function(pTester) {
var actualValue = KeywordUtils.getCategoryIdByName();
pTester.expectThat(actualValue).equals("").assert();
}
),
]);
var getEntryNamesAndIdsByContainer = new TestSuite("KeywordUtils.getEntryNamesAndIdsByContainer", [
new Test("should return an array of all keywords and their ID's for given container",
function(pTester) {
......@@ -107,6 +131,7 @@ var tester = new Tester("Test Keyword_lib");
tester.initCoverage(KeywordUtils);
tester.test(getContainerNames);
tester.test(getCategoryNameById);
tester.test(getCategoryIdByName);
tester.test(getEntryNamesAndIdsByContainer);
tester.test(exists);
......
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