From 7cdb291641bdd193e71ee0976bd12bde04448451 Mon Sep 17 00:00:00 2001 From: Katie Date: Wed, 5 Oct 2022 14:58:55 -0400 Subject: [PATCH] CSR-762 WIP --- .../base-input-button/base-input-button.spec.js | 10 +++++++++- .../base-input-button/base-input-button.vue | 16 ++++++++-------- .../button-question/button-question.vue | 2 ++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/common-components/base-input-button/base-input-button.spec.js b/src/common-components/base-input-button/base-input-button.spec.js index 9a6e7c168..37e6ccc19 100644 --- a/src/common-components/base-input-button/base-input-button.spec.js +++ b/src/common-components/base-input-button/base-input-button.spec.js @@ -249,8 +249,16 @@ describe("baseInputButton.vue", () => { describe("handleEventAction", () => {}); describe("handleSelectionChange", () => { + test.todo("handleChange is called with valueToEmit") + describe("checkbox", () => { - test.todo("modelValue is null => inputButtonClicked is emitted with correct") + test.todo("modelValue is null => valueToEmit is correct value") + + test.todo("modelValue is undefined => valueToEmit is correct value") + test.todo("modelValue is empty => valueToEmit is correct value") + + test.todo("modelValue is not empty and does not contain this button's value => valueToEmit is correct value") + test.todo("modelValue is not empty and does contain this button's value => valueToEmit is correct value") }) describe("radio", () => { diff --git a/src/common-components/base-input-button/base-input-button.vue b/src/common-components/base-input-button/base-input-button.vue index e82f7438f..dbde633a7 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -97,7 +97,7 @@ export default { } } else { switch (eventType) { - case eventTypes.CLICK: + case eventTypes.CLICK: // TODO KO pushClickEventToGa? case eventTypes.ENTER: case eventTypes.SPACE: this.handleClick(e); @@ -141,13 +141,13 @@ export default { handleClick(e) { this.handleSelectionChange(e); // console.log("addEventToBus: ", this.value?.toString()) - // eventBus.addEventToBus("GA", "click", { - // category: this.$route.query[queryStrings.FMG_PAGE], - // action: this.GaActions.CLICKED, - // label: this.value?.toString(), - // pushToLogApp: true, - // valueToLogType: this.valueToLogType, - // }); + eventBus.addEventToBus("GA", "click", { + category: this.$route.query[queryStrings.FMG_PAGE], + action: this.GaActions.CLICKED, + label: this.value?.toString(), + pushToLogApp: true, + valueToLogType: this.valueToLogType, + }); this.$emit("inputButtonClicked", this.valueToEmit); }, // pushClickEventToGA(value) { diff --git a/src/common-components/button-question/button-question.vue b/src/common-components/button-question/button-question.vue index c36d9af44..d607d6091 100644 --- a/src/common-components/button-question/button-question.vue +++ b/src/common-components/button-question/button-question.vue @@ -262,11 +262,13 @@ export default { } }, handleFocus(e) { + console.log("B") this.$root.handleInputFocus({ groupName: this.groupName, }); }, handleBlur(e) { + console.log("A") this.$root.handleInputBlur({ groupName: this.groupName, onFocusCallback: this.onFocusCallbackForRoot,