diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 47a7a1a32..ea72124b9 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -1,5 +1,5 @@ diff --git a/src/ux-components/alert/alert.spec.js b/src/ux-components/alert/alert.spec.js index b7a800913..f046009a4 100644 --- a/src/ux-components/alert/alert.spec.js +++ b/src/ux-components/alert/alert.spec.js @@ -1,5 +1,4 @@ import { shallowMount } from "@vue/test-utils"; -import { createStore } from 'vuex' import alert from "./alert"; describe("alert.vue", () => { @@ -11,7 +10,7 @@ describe("alert.vue", () => { isDismissible: true }, computed: { - alertCopy: { + splitAlertCopyForLink: { get() { return "TEST"; }, @@ -33,7 +32,7 @@ describe("alert.vue", () => { alertClass: 'warning' }, computed: { - alertCopy: { + splitAlertCopyForLink: { get() { return "TEST"; }, @@ -48,9 +47,10 @@ describe("alert.vue", () => { expect(wrapperDiv.classes()).toContain('warning') }); - it("Should return original string if no custom string notations added", async () => { + it("Should update headline when manual headline added", async () => { // Arrange const wrapper = shallowMount(alert, { + computed: { alertCopy: { get() { @@ -61,69 +61,11 @@ describe("alert.vue", () => { mixins: [mockMixin] }); - const stringWithNoCustomAtrributes = wrapper.vm.checkForCustomStrings("Test string") + await wrapper.vm.$nextTick(); + const wrapperDiv = wrapper.find('.text-body'); // Assert - expect(stringWithNoCustomAtrributes).toEqual("Test string") - }); - - it("Should return link when custom string notation with 'routerLink' included", async () => { - // Arrange - const wrapper = shallowMount(alert, { - computed: { - alertCopy: { - get() { - return "TEST"; - }, - } - }, - mixins: [mockMixin] - }); - - const stringWithNoCustomAtrributes = wrapper.vm.checkForCustomStrings("{routerLink:clickedChangeVinLookupMethod,provide your VIN}") - - // Assert - expect(stringWithNoCustomAtrributes).toEqual("{routerLink:clickedChangeVinLookupMethod,provide your VIN}") - }); - - it("Should return zip when custom string notation with 'custom' for zip is called.", async () => { - // Arrange - const wrapper = shallowMount(alert, { - propsData: {modelValue: {zip: "12345"}}, - computed: { - alertCopy: { - get() { - return "TEST"; - }, - } - }, - mixins: [mockMixin] - }); - - const stringWithNoCustomAtrributes = wrapper.vm.checkForCustomStrings("{custom:zip}") - - // Assert - expect(stringWithNoCustomAtrributes).toEqual("12345") - }); - - it("Should return custom datum specified when custom string notation with 'custom' for lookup is called.", async () => { - // Arrange - const wrapper = shallowMount(alert, { - propsData: {modelValue: {vehicleInfo: {year: "2020"}}}, - computed: { - alertCopy: { - get() { - return "TEST"; - }, - } - }, - mixins: [mockMixin] - }); - - const stringWithNoCustomAtrributes = wrapper.vm.checkForCustomStrings("{custom:plateLookupYear}") - - // Assert - expect(stringWithNoCustomAtrributes).toEqual("2020") + expect(wrapperDiv.text()).toEqual('TEST') }); }); diff --git a/src/ux-components/alert/alert.vue b/src/ux-components/alert/alert.vue index f341334fa..c20ec74f0 100644 --- a/src/ux-components/alert/alert.vue +++ b/src/ux-components/alert/alert.vue @@ -4,9 +4,9 @@ role="alert" :class="[isDismissible ? 'alert-dismissible' : '', this.alertClass]" > -

-

-