Browse Source

HUE-9084 [frontend] Fix parser test utils exception when there are no keywords

Johan Ahlen 5 years ago
parent
commit
3248571896
1 changed files with 1 additions and 1 deletions
  1. 1 1
      desktop/core/src/desktop/js/jest/sqlTestUtils.js

+ 1 - 1
desktop/core/src/desktop/js/jest/sqlTestUtils.js

@@ -230,7 +230,7 @@ expect.extend({
       deleteKeywords = true;
       deleteKeywords = true;
     }
     }
     if (typeof testDefinition.doesNotContainKeywords !== 'undefined') {
     if (typeof testDefinition.doesNotContainKeywords !== 'undefined') {
-      const keywords = actualResponse.suggestKeywords;
+      const keywords = actualResponse.suggestKeywords || [];
       let contains = false;
       let contains = false;
       testDefinition.doesNotContainKeywords.forEach(keyword => {
       testDefinition.doesNotContainKeywords.forEach(keyword => {
         if (typeof keywords === 'undefined' || keywords.indexOf(keyword) !== -1) {
         if (typeof keywords === 'undefined' || keywords.indexOf(keyword) !== -1) {