From 0a315b4d577ee52d9efc33beb019c53b1530034a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 5 Apr 2020 14:36:46 +0000 Subject: [PATCH] --- ayanova/src/components/pick-list.vue | 13 ++++++++++++- ayanova/tests/e2e/specs/select-list-templates.js | 12 +++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ayanova/src/components/pick-list.vue b/ayanova/src/components/pick-list.vue index 299a0958..4ae818cb 100644 --- a/ayanova/src/components/pick-list.vue +++ b/ayanova/src/components/pick-list.vue @@ -83,11 +83,17 @@ export default { //clear any local errors vm.clearErrors(); //if the search entry is in the results list then it's a drop down selection not a typed search so bail + console.log( + "watch searchentry checking if search or selection for entry:", + val + ); for (let i = 0; i < vm.searchResults.length; i++) { if (vm.searchResults[i].name == val) { + console.log("Yes, match, bail no search"); return; } } + console.log("past entry check, maybe search?"); if (!val || vm.fetching || !vm.initialized) { if (!vm.initialized) { vm.$nextTick(() => { @@ -96,7 +102,8 @@ export default { } return; } - //console.log("watch::searchentry - calling do search:"); + console.log("watch::searchentry - calling do search on :", val); + this.doSearch(); }, errors(val) { @@ -267,6 +274,7 @@ export default { //NOTE debounce with a watcher is a bit different, currently it has to be done exactly this way, nothing else will work properly //https://vuejs.org/v2/guide/migration.html#debounce-Param-Attribute-for-v-model-removed //----------------- + console.log("doSearch top, search for:", vm.searchEntry); let vm = this; let isATwoTermQuery = false; let queryTerms = []; @@ -282,6 +290,7 @@ export default { if (val.includes(" ")) { queryTerms = val.split(" "); if (queryTerms.length > 2) { + console.log("Query invalid 1"); vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid")); return; } @@ -317,6 +326,7 @@ export default { window.$gz._.startsWith(queryTerms[0], "..") && window.$gz._.startsWith(queryTerms[1], "..") ) { + console.log("Query invalid 2"); vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid")); return; } @@ -326,6 +336,7 @@ export default { !window.$gz._.startsWith(queryTerms[0], "..") && !window.$gz._.startsWith(queryTerms[1], "..") ) { + console.log("Query invalid 3"); vm.errors.push(vm.$ay.t("ErrorPickListQueryInvalid")); return; } diff --git a/ayanova/tests/e2e/specs/select-list-templates.js b/ayanova/tests/e2e/specs/select-list-templates.js index f78e922a..4eb9868b 100644 --- a/ayanova/tests/e2e/specs/select-list-templates.js +++ b/ayanova/tests/e2e/specs/select-list-templates.js @@ -21,13 +21,19 @@ describe("PICK LIST TEMPLATE", () => { cy.get("[data-cy=SelectTemplate]").type("3{enter}", { force: true }); //hide tags field - cy.get("[data-cy=useremployeenumberInclude]").uncheck({ force: true }); + cy.get("[data-cy=usertagsInclude]").uncheck({ force: true }); + // cy.get( + // '[data-cy="adm-global-select-templates:save"] > .v-btn__content > .v-icon' + // ).click(); cy.get( '[data-cy="adm-global-select-templates:save"] > .v-btn__content > .v-icon' - ).click(); + ).click({ force: true }); cy.visit("/widgets/0"); cy.url().should("include", "/widgets/0"); - cy.get("[data-cy=userid] > .v-input").type("a ..zone"); + //select a user with a zone set + cy.get("[data-cy=userid] > .v-input").type( + "..zone{downarrow}{downarrow}{enter}" + ); //tags is off so there shouldn't be any "zones" visible in there //----------------- });