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:
brich1212safe 2024-04-08 10:02:00 -04:00 committed by GitHub
commit 88fff35aa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 44 additions and 11 deletions

View file

@ -10,8 +10,8 @@ const applicationConfig = Object.freeze({
ANALYTICS_SESSION_TIMEOUT_MINUTES: 30,
SAVED_SESSION_TIMEOUT_DAYS: 45,
COOKIE_PATH: '/',
APPLICATION_NAME: 'SelfService',
SITE_ENTRY_TRIGGER_VALUE: 'SelfService',
APPLICATION_NAME: 'ISS',
SITE_ENTRY_TRIGGER_VALUE: 'ISS',
APPLICATION_ABBREVIATION: 'iss',
PAGE_QUERYSTRING: 'issPage',
CLIENTTAG_QUERYSTRING: 'ClientTag',

View file

@ -3,7 +3,8 @@ const experimentUniverses = 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({

View file

@ -11,7 +11,7 @@ export default {
return new Promise((resolve, reject) => {
const store = useMainStore();
const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO;
const payloadAndAnalyticsData = { ...payload, AppName: 'SelfService' };
const payloadAndAnalyticsData = { ...payload, AppName: 'ISS' };
const headers = {
[headerKeys.EXPERIMENT]: JSON.stringify(store.experimentSettings)
};

View file

@ -8,6 +8,7 @@ import { useMainStore } from '@/store';
import issPageValues from '@/router/router-constants/issPage-values';
import { paymentMethods } from '@/constants/payment-method-constants';
import queryStrings from '@/constants/query-strings';
import { experimentSettings } from '@/constants/experiments';
function setupMocks({ customMountOptions = {}, queryString }) {
const mountOptions = getMountOptions({
@ -15,6 +16,20 @@ function setupMocks({ customMountOptions = {}, queryString }) {
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);
return wrapper;

View file

@ -34,10 +34,16 @@
alertClass="alert-danger"
:isDismissible="false" />
<paymentMethodQuestion
v-model="paymentMethodInternalModel"
cmsWidgetName="PaymentMethodWidget"
:validationRules="rules.optionRequired" />
<div>Pia Disabled Placeholder</div>
v-if="!isPayInAdvanceDisabled"
v-model="paymentMethodInternalModel"
cmsWidgetName="PaymentMethodWidget"
:validationRules="rules.optionRequired" />
<alert
v-if="isPayInAdvanceDisabled"
:isDismissible="false"
alertClass="alert-info"
cmsWidgetName="NoPayInAdvanceDisclaimerWidget"
:shouldScrollToOnMount="false" />
<siteFooter
ref="siteFooter"
cmsWidgetName="SiteFooterWidget"
@ -64,6 +70,7 @@ import alert from '@/ux-components/alert/alert.vue';
// Supporting Items
import settleAllPromises from '@/helpers/layout-helper';
import { useMainStore } from '@/store';
import { experimentSettings } from '@/constants/experiments';
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
import { paymentMethods } from '@/constants/payment-method-constants';
import queryStrings from '@/constants/query-strings';
@ -163,13 +170,23 @@ export default {
return null;
}
},
paymentMethod() {
return this.paymentMethodInternalModel;
},
displayPayInAdvanceAlert() {
return (
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: {