Merge pull request #609 from Safelite/feature/richardson/SSR-1104.2
Include Experiment Setting for whether to display PIA message/questions
This commit is contained in:
commit
88fff35aa3
5 changed files with 44 additions and 11 deletions
|
|
@ -10,8 +10,8 @@ const applicationConfig = Object.freeze({
|
||||||
ANALYTICS_SESSION_TIMEOUT_MINUTES: 30,
|
ANALYTICS_SESSION_TIMEOUT_MINUTES: 30,
|
||||||
SAVED_SESSION_TIMEOUT_DAYS: 45,
|
SAVED_SESSION_TIMEOUT_DAYS: 45,
|
||||||
COOKIE_PATH: '/',
|
COOKIE_PATH: '/',
|
||||||
APPLICATION_NAME: 'SelfService',
|
APPLICATION_NAME: 'ISS',
|
||||||
SITE_ENTRY_TRIGGER_VALUE: 'SelfService',
|
SITE_ENTRY_TRIGGER_VALUE: 'ISS',
|
||||||
APPLICATION_ABBREVIATION: 'iss',
|
APPLICATION_ABBREVIATION: 'iss',
|
||||||
PAGE_QUERYSTRING: 'issPage',
|
PAGE_QUERYSTRING: 'issPage',
|
||||||
CLIENTTAG_QUERYSTRING: 'ClientTag',
|
CLIENTTAG_QUERYSTRING: 'ClientTag',
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@ const experimentUniverses = Object.freeze({
|
||||||
});
|
});
|
||||||
|
|
||||||
const experimentSettings = Object.freeze({
|
const experimentSettings = Object.freeze({
|
||||||
GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index'
|
GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index',
|
||||||
|
ISS_DISPLAY_PAY_IN_ADVANCE: 'ISSDisplayPIAInsurance_ISS'
|
||||||
});
|
});
|
||||||
|
|
||||||
const experimentTriggers = Object.freeze({
|
const experimentTriggers = Object.freeze({
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ export default {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const store = useMainStore();
|
const store = useMainStore();
|
||||||
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
|
||||||
const payloadAndAnalyticsData = { ...payload, AppName: 'SelfService' };
|
const payloadAndAnalyticsData = { ...payload, AppName: 'ISS' };
|
||||||
const headers = {
|
const headers = {
|
||||||
[headerKeys.EXPERIMENT]: JSON.stringify(store.experimentSettings)
|
[headerKeys.EXPERIMENT]: JSON.stringify(store.experimentSettings)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import { useMainStore } from '@/store';
|
||||||
import issPageValues from '@/router/router-constants/issPage-values';
|
import issPageValues from '@/router/router-constants/issPage-values';
|
||||||
import { paymentMethods } from '@/constants/payment-method-constants';
|
import { paymentMethods } from '@/constants/payment-method-constants';
|
||||||
import queryStrings from '@/constants/query-strings';
|
import queryStrings from '@/constants/query-strings';
|
||||||
|
import { experimentSettings } from '@/constants/experiments';
|
||||||
|
|
||||||
function setupMocks({ customMountOptions = {}, queryString }) {
|
function setupMocks({ customMountOptions = {}, queryString }) {
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
|
|
@ -15,6 +16,20 @@ function setupMocks({ customMountOptions = {}, queryString }) {
|
||||||
route: { query: { issPage: issPageValues.PAYMENT_METHOD, ...queryString }, params: {} }
|
route: { query: { issPage: issPageValues.PAYMENT_METHOD, ...queryString }, params: {} }
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getSettingValue: jest.fn((settingName) => {
|
||||||
|
if (settingName === experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE) {
|
||||||
|
return 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'false';
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mountOptions.global.mixins = [mockMixin];
|
||||||
|
|
||||||
const wrapper = shallowMount(paymentMethod, mountOptions);
|
const wrapper = shallowMount(paymentMethod, mountOptions);
|
||||||
|
|
||||||
return wrapper;
|
return wrapper;
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,16 @@
|
||||||
alertClass="alert-danger"
|
alertClass="alert-danger"
|
||||||
:isDismissible="false" />
|
:isDismissible="false" />
|
||||||
<paymentMethodQuestion
|
<paymentMethodQuestion
|
||||||
v-model="paymentMethodInternalModel"
|
v-if="!isPayInAdvanceDisabled"
|
||||||
cmsWidgetName="PaymentMethodWidget"
|
v-model="paymentMethodInternalModel"
|
||||||
:validationRules="rules.optionRequired" />
|
cmsWidgetName="PaymentMethodWidget"
|
||||||
<div>Pia Disabled Placeholder</div>
|
:validationRules="rules.optionRequired" />
|
||||||
|
<alert
|
||||||
|
v-if="isPayInAdvanceDisabled"
|
||||||
|
:isDismissible="false"
|
||||||
|
alertClass="alert-info"
|
||||||
|
cmsWidgetName="NoPayInAdvanceDisclaimerWidget"
|
||||||
|
:shouldScrollToOnMount="false" />
|
||||||
<siteFooter
|
<siteFooter
|
||||||
ref="siteFooter"
|
ref="siteFooter"
|
||||||
cmsWidgetName="SiteFooterWidget"
|
cmsWidgetName="SiteFooterWidget"
|
||||||
|
|
@ -64,6 +70,7 @@ import alert from '@/ux-components/alert/alert.vue';
|
||||||
// Supporting Items
|
// Supporting Items
|
||||||
import settleAllPromises from '@/helpers/layout-helper';
|
import settleAllPromises from '@/helpers/layout-helper';
|
||||||
import { useMainStore } from '@/store';
|
import { useMainStore } from '@/store';
|
||||||
|
import { experimentSettings } from '@/constants/experiments';
|
||||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||||
import { paymentMethods } from '@/constants/payment-method-constants';
|
import { paymentMethods } from '@/constants/payment-method-constants';
|
||||||
import queryStrings from '@/constants/query-strings';
|
import queryStrings from '@/constants/query-strings';
|
||||||
|
|
@ -163,13 +170,23 @@ export default {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
paymentMethod() {
|
|
||||||
return this.paymentMethodInternalModel;
|
|
||||||
},
|
|
||||||
displayPayInAdvanceAlert() {
|
displayPayInAdvanceAlert() {
|
||||||
return (
|
return (
|
||||||
this.$route.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT]
|
this.$route.query[queryStrings.DISPLAY_PAY_IN_ADVANCE_ALERT]
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
isPayInAdvanceDisabled() {
|
||||||
|
const piaExperience = this.getSettingValue(experimentSettings.ISS_DISPLAY_PAY_IN_ADVANCE);
|
||||||
|
const isEnabled = piaExperience === 'true';
|
||||||
|
|
||||||
|
return !isEnabled || this.isUnverified;
|
||||||
|
},
|
||||||
|
isUnverified() {
|
||||||
|
return !useMainStore().isNoComp && !useMainStore().isITAC
|
||||||
|
&& (useMainStore().order.currentDeductible == null || !useMainStore().isVerifiedCoverageStatus);
|
||||||
|
},
|
||||||
|
paymentMethod() {
|
||||||
|
return this.paymentMethodInternalModel;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue