From 4f6f6242a0884bddac594730307aa1957cd1ed54 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 15 Mar 2022 18:52:36 -0400 Subject: [PATCH] CSR-319: expand Alert component to allow for multiple paragraphs --- src/layouts/component-test/component-test.vue | 10 ++++++ src/layouts/vehicle-damage/vehicle-damage.vue | 2 +- .../windshield-options/windshield-options.vue | 2 +- src/ux-components/alert/alert.spec.js | 31 ++++++++++++++++++- src/ux-components/alert/alert.vue | 17 ++++++++-- 5 files changed, 57 insertions(+), 5 deletions(-) diff --git a/src/layouts/component-test/component-test.vue b/src/layouts/component-test/component-test.vue index 5ff4141fd..e14899d56 100644 --- a/src/layouts/component-test/component-test.vue +++ b/src/layouts/component-test/component-test.vue @@ -1129,6 +1129,16 @@ /> +
+
+ +
+
diff --git a/src/layouts/vehicle-damage/vehicle-damage.vue b/src/layouts/vehicle-damage/vehicle-damage.vue index 20df6fb57..8520e568c 100644 --- a/src/layouts/vehicle-damage/vehicle-damage.vue +++ b/src/layouts/vehicle-damage/vehicle-damage.vue @@ -26,7 +26,7 @@ v-show="hasRepairReplaceConflict" alertClass="alert-danger" alertHeadline="You'll need to schedule separate appointments" - alertCopy="Vehicle service requiring both glass repair and replacement must be scheduled separately, as they're performed by different technicians. Continue scheduling your first service now, and then come back to schedule the second service." + :alertCopy="['Vehicle service requiring both glass repair and replacement must be scheduled separately, as they\'re performed by different technicians.', 'Continue scheduling your first service now, and then come back to schedule the second service.']" :isDismissible="false" /> { + + it("Should set isMultiParagraph to true if alertCopy is an array of strings", async () => { + // Arrange + const wrapper = shallowMount(alert, { + propsData: { + alertCopy: ["one", "two"] + }, + }); + + // Assert + expect(wrapper.vm.isMultiParagraph).toBe(true); + }); + + it("Should set isMultiParagraph to false if alertCopy is a single string", async () => { + // Arrange + const wrapper = shallowMount(alert, { + propsData: { + alertCopy: "three" + }, + }); + + // Assert + expect(wrapper.vm.isMultiParagraph).toBe(false); + }); + +}); diff --git a/src/ux-components/alert/alert.vue b/src/ux-components/alert/alert.vue index 89bd366a3..56e97cb4d 100644 --- a/src/ux-components/alert/alert.vue +++ b/src/ux-components/alert/alert.vue @@ -5,7 +5,12 @@ :class="[isDismissible ? 'alert-dismissible' : '', this.alertClass]" >

{{ alertHeadline }}

-

{{ alertCopy }}

+ +

+ {{ para }} +

+
+

{{ alertCopy }}