Merge branch 'develop' into feature/digital/SSR-363
This commit is contained in:
commit
f678819aad
4 changed files with 92 additions and 4 deletions
45
src/iss-components/steering-text/steering-text.spec.js
Normal file
45
src/iss-components/steering-text/steering-text.spec.js
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
import { shallowMount } from "@vue/test-utils";
|
||||||
|
import steeringTextModal from "./steering-text";
|
||||||
|
import { createApp } from 'vue';
|
||||||
|
import { createPinia } from "pinia";
|
||||||
|
import App from '@/App.vue';
|
||||||
|
|
||||||
|
describe("steering-text.vue", () => {
|
||||||
|
test("Should display steering text from CMS for state MA", async () => {
|
||||||
|
// Act
|
||||||
|
|
||||||
|
const wrapper = shallowMount(steeringTextModal, {
|
||||||
|
mixins: [mockMixin],
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: "MASteeringTextWidget",
|
||||||
|
},
|
||||||
|
attachTo: document.body,
|
||||||
|
});
|
||||||
|
expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["BodyText"]));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const vueApp = createApp(App);
|
||||||
|
const pinia = createPinia();
|
||||||
|
vueApp.use(pinia);
|
||||||
|
///////////////
|
||||||
|
// Constants //
|
||||||
|
///////////////
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn((widgetName, cmsFieldName) => {
|
||||||
|
return mockCmsContent[cmsFieldName];
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const mockCmsContent = {
|
||||||
|
BodyText: "MASteeringText",
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
37
src/iss-components/steering-text/steering-text.vue
Normal file
37
src/iss-components/steering-text/steering-text.vue
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<textBlock
|
||||||
|
cmsWidgetName="MASteeringText"
|
||||||
|
id="SteeringTextContent"
|
||||||
|
/>
|
||||||
|
<div>
|
||||||
|
<p class="small" v-if="isStateMA" v-html="MASteeringText" ></p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { useMainStore } from "@/store";
|
||||||
|
|
||||||
|
export default{
|
||||||
|
name: "steeringTextModal",
|
||||||
|
computed: {
|
||||||
|
MASteeringText() {
|
||||||
|
return this.getCmsContent("MASteeringText", "BodyText");
|
||||||
|
},
|
||||||
|
isStateMA()
|
||||||
|
{
|
||||||
|
if (this.mainStore.order.customer.address.state=='MA')
|
||||||
|
{
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setup() {
|
||||||
|
const mainStore = useMainStore();
|
||||||
|
return { mainStore };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<recalModal cmsWidgetName="RecalModal" />
|
<recalModal cmsWidgetName="RecalModal" />
|
||||||
|
<steeringText cmsWidgetName="MASteeringText" ></steeringText>
|
||||||
<siteFooter
|
<siteFooter
|
||||||
cmsWidgetName="SiteFooterWidget"
|
cmsWidgetName="SiteFooterWidget"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
|
@ -55,7 +56,7 @@ import siteHeader from '@/iss-components/site-header/site-header.vue';
|
||||||
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
|
||||||
import textBlock from "@/digital-components/text-block/text-block";
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
import recalModal from '@/layouts/coverage-statement/recal-modal/recal-modal.vue';
|
import recalModal from '@/layouts/coverage-statement/recal-modal/recal-modal.vue';
|
||||||
|
import steeringText from "@/iss-components/steering-text/steering-text.vue";
|
||||||
// Import Supporting Files
|
// Import Supporting Files
|
||||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||||
|
|
@ -72,7 +73,8 @@ export default {
|
||||||
siteSubHeader,
|
siteSubHeader,
|
||||||
Form,
|
Form,
|
||||||
textBlock,
|
textBlock,
|
||||||
recalModal
|
recalModal,
|
||||||
|
steeringText
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
bodyText() {
|
bodyText() {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="page-container-grouped-styles overflow-auto">
|
<div class="page-container-grouped-styles overflow-auto">
|
||||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||||
<siteSubHeader cmsWidgetName="SiteSubHeader" id="sub-header" />
|
<siteSubHeader cmsWidgetName="SiteSubHeader" id="sub-header" />
|
||||||
<div class="fade-on-route-transition sub-container make-tall px-5">
|
<div class="fade-on-route-transition sub-container make-tall overflow-scroller px-5">
|
||||||
<div v-html="ProviderPreferenceHeaderText" class="text-center mt-4 mb-4" ></div>
|
<div v-html="ProviderPreferenceHeaderText" class="text-center mt-4 mb-4" ></div>
|
||||||
<div
|
<div
|
||||||
v-html="ProviderPreferenceBodyText"
|
v-html="ProviderPreferenceBodyText"
|
||||||
|
|
@ -118,6 +118,10 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
.overflow-scroller {
|
||||||
|
height: calc(100% - 220px) !important;
|
||||||
|
overflow-X: hidden !important;
|
||||||
|
}
|
||||||
#sub-header span{
|
#sub-header span{
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue