From 81a35dd0bb87b69b0f7d44173d44bb5a7c7f0b25 Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Mon, 5 Dec 2022 16:08:35 -0500 Subject: [PATCH 1/3] Fix console warning in DevTools --- src/layouts/vehicle-year/year-question/year-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/vehicle-year/year-question/year-question.vue b/src/layouts/vehicle-year/year-question/year-question.vue index 84dfd15f..8af5fce9 100644 --- a/src/layouts/vehicle-year/year-question/year-question.vue +++ b/src/layouts/vehicle-year/year-question/year-question.vue @@ -24,7 +24,7 @@ }; }, props: { - modelValue: String, + modelValue: Number, cmsWidgetName: String, }, components: { From 8a1933d76f055873c7b5c4f77481a458f5024ce0 Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Mon, 5 Dec 2022 16:10:45 -0500 Subject: [PATCH 2/3] Change String to Number The actual implementation in the component is using number instead of a string. The tests should match that. --- .../vehicle-year/year-question/year-question.spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layouts/vehicle-year/year-question/year-question.spec.js b/src/layouts/vehicle-year/year-question/year-question.spec.js index c5e418d1..39138d8f 100644 --- a/src/layouts/vehicle-year/year-question/year-question.spec.js +++ b/src/layouts/vehicle-year/year-question/year-question.spec.js @@ -6,8 +6,8 @@ import { useMainStore } from "@/store"; describe("year-question.vue", () => { test("Selected year is emitted upon selection.", async () => { //Arrange - const { wrapper } = setupMocks({ modelValueProp: "2020" }); - const yearToSelect = "2021"; + const { wrapper } = setupMocks({ modelValueProp: 2020 }); + const yearToSelect = 2021; //Act wrapper.setValue({ modelValue: yearToSelect }); @@ -15,7 +15,7 @@ describe("year-question.vue", () => { //Assert expect(wrapper.emitted()["update:modelValue"][0]).toEqual([ - { modelValue: "2021" }, + { modelValue: 2021 }, ]); }); }); @@ -24,7 +24,7 @@ describe("year-question.vue", () => { test("Data from store api are used as radio question answers.", async () => { //Arrange const { wrapper, cmsContent } = setupMocks({ - dataFromStoreApi: ["2023", "2022", "2021"], + dataFromStoreApi: [2023, 2022, 2021], }); //Act @@ -46,7 +46,7 @@ describe("year-question.vue", () => { function setupMocks({ - modelValueProp = "1900", + modelValueProp = 1900, cmsQuestionText = "CMS text goes here", dataFromStoreApi = [], }) { From 75b7833a802cf2b1f69eb95ab611ceb5566d1423 Mon Sep 17 00:00:00 2001 From: Johan Gunawan Date: Mon, 5 Dec 2022 17:13:34 -0500 Subject: [PATCH 3/3] Remove unnecessary computed SiteSubHeader component already has a computed property for backButtonAccessibleText. --- src/layouts/vehicle-make/vehicle-make.vue | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/layouts/vehicle-make/vehicle-make.vue b/src/layouts/vehicle-make/vehicle-make.vue index baa96ece..c7b9e0f1 100644 --- a/src/layouts/vehicle-make/vehicle-make.vue +++ b/src/layouts/vehicle-make/vehicle-make.vue @@ -5,9 +5,8 @@
@@ -97,12 +96,6 @@ this.$route ); }, - }, - computed: { - backButtonAccessibleText() - { - return this.getCmsContent(this.cmsWidgetName, "BackButtonAccessibleText") - }, - }, + } }; \ No newline at end of file