diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 1fc6c2b8f..0a67c8c96 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -74,6 +74,10 @@ const endpoints = { url: "/parts/api/v1/parts/rain-defense", method: "GET", }, + GetMobileFeePart: { + url: "/parts/api/v1/parts/mobile-fee", + method: "GET", + }, GetSupportingItems: { url: "/parts/api/v1/parts/supporting-items", method: "POST", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 7e3259057..2b7033e10 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -28,6 +28,7 @@ const storeActions = { GET_CAPABILITY_QUESTIONS: "getCapabilityQuestions", GET_PART_FROM_CAPABILITY_QUESTION_ANSWER: "getPartFromCapabilityQuestionAnswer", GET_MOLDING_QUESTIONS: "getMoldingQuestions", + GET_MOBILE_FEE_PART: "getMobileFeePart", SAVE_SESSION: "saveSession", LOAD_SESSION: "loadSession", UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE: "updateStoreWithSaveSessionResponse", diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index e60dcbebc..44a427275 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -56,6 +56,7 @@ https://safelite.atlassian.net/wiki/spaces/DC/pages/76644418/Button+Question+Com :lastValuePushedToGa="lastValuePushedToGa" :setLastValuePushedToGa="setLastValuePushedToGa" :suppressError="suppressError" + @buttonEvent="handleButtonEvent" v-model="selectedValues" /> @@ -220,6 +221,10 @@ export default { setLastValuePushedToGa(lastValuePushedToGa) { this.lastValuePushedToGa = lastValuePushedToGa; }, + handleButtonEvent(event) { + const eventName = event.eventName; + this.$emit(`buttonEvent.${eventName}`, event.args); + }, }, components: { listButton, diff --git a/src/digital-components/dropdown-question/dropdown-question.spec.js b/src/digital-components/dropdown-question/dropdown-question.spec.js index a606e3d19..654709926 100644 --- a/src/digital-components/dropdown-question/dropdown-question.spec.js +++ b/src/digital-components/dropdown-question/dropdown-question.spec.js @@ -1,5 +1,6 @@ import { shallowMount } from "@vue/test-utils"; import dropdownQuestion from "./dropdown-question"; +import crypto from "crypto"; // Mock CMS content const questionText = "Question Text"; @@ -11,6 +12,8 @@ const mockMixin = { }, }; +global.crypto = crypto; + // TODO: Remove the following from dropdown-question.vue -> :class="(errors && errors.length) || hasError ? 'has-error' : ''" // It is not being used. describe("dropdownQuestion.vue", () => { @@ -46,23 +49,6 @@ describe("dropdownQuestion.vue", () => { expect(label.text()).toContain(questionText); }); - it("Should return input id as the id of the select field", async () => { - // Arrange - const wrapper = shallowMount(dropdownQuestion, { - propsData: { - inputId: "input ID", - options: {}, - }, - mixins: [mockMixin], - }); - - // Act - const select = wrapper.find("select"); - - // Assert - expect(select.attributes().id).toEqual("input ID"); - }); - it("Should render the 'questionText' data value as the aria-label attribute.", async () => { // Arrange const wrapper = shallowMount(dropdownQuestion, { @@ -118,7 +104,7 @@ describe("dropdownQuestion.vue", () => { const wrapper = shallowMount(dropdownQuestion, { propsData: { options: {}, - modelValue: 0, + modelValue: "0", }, mixins: [mockMixin], }); diff --git a/src/digital-components/dropdown-question/dropdown-question.vue b/src/digital-components/dropdown-question/dropdown-question.vue index bdc36a0d8..e122837c4 100644 --- a/src/digital-components/dropdown-question/dropdown-question.vue +++ b/src/digital-components/dropdown-question/dropdown-question.vue @@ -6,7 +6,7 @@ :for="inputId" :aria-label="questionText" class="form-label" - v-html="labelText"> + v-html="questionText">