Merge pull request #1739 from Safelite/feature/CSR-1438.2
Revert "Email optional"
This commit is contained in:
commit
1b04aa9e7e
12 changed files with 14 additions and 85 deletions
|
|
@ -8,7 +8,6 @@ const experimentSettings = {
|
|||
DISPLAY_AVAILABILITY_INDICATORS: "DisplayAvailabilityIndicators",
|
||||
PIA_EXPERIENCE: "PIA Experience",
|
||||
SUBMIT_ORDER_ENABLE_PIA: "SubmitOrder_Enable_PIA",
|
||||
IS_EMAIL_OPTIONAL: "isEmailOptional",
|
||||
};
|
||||
|
||||
const experimentTriggers = {
|
||||
|
|
|
|||
|
|
@ -125,10 +125,6 @@ export default {
|
|||
hideInput: Boolean,
|
||||
centerErrorMessage: Boolean,
|
||||
keyDownHandler: Function,
|
||||
isEmailOptional: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const uuid = uuidv4();
|
||||
|
|
@ -206,9 +202,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
questionText() {
|
||||
return this.isEmailOptional
|
||||
? this.getCmsContent(this.cmsWidgetName, "QuestionText") + " (optional)"
|
||||
: this.getCmsContent(this.cmsWidgetName, "QuestionText");
|
||||
return this.getCmsContent(this.cmsWidgetName, "QuestionText");
|
||||
},
|
||||
value: {
|
||||
get: function () {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import { storeMutations } from "@/constants/store-mutations";
|
|||
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
||||
import store from "@/store";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
|
||||
jest.mock("@/helpers/damage-helper", () => ({
|
||||
isGlassAvailableForCarId: jest.fn().mockImplementation(() => true),
|
||||
|
|
@ -642,17 +641,6 @@ describe("address-lookup.vue", () => {
|
|||
});
|
||||
});
|
||||
|
||||
const mockMixin = {
|
||||
methods: {
|
||||
getSettingValue: jest.fn((settingName) => {
|
||||
if (settingName === experimentSettings.IS_EMAIL_OPTIONAL) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
function setupMocks({
|
||||
isZipValid = true,
|
||||
isZipServiceable = true,
|
||||
|
|
@ -721,7 +709,6 @@ function setupMocks({
|
|||
},
|
||||
},
|
||||
},
|
||||
mixins: [mockMixin],
|
||||
})
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -20,11 +20,7 @@
|
|||
|
||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" ref="funnelSubHeader" />
|
||||
|
||||
<customerQuestions
|
||||
ref="customerQuestions"
|
||||
v-model="customerQuestions"
|
||||
:validationRules="EmailValidationRules"
|
||||
:isEmailOptional="IsEmailOptional" />
|
||||
<customerQuestions ref="customerQuestions" v-model="customerQuestions" />
|
||||
|
||||
<alert
|
||||
ref="alertVinNotFound"
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@
|
|||
v-model="customerModel.emailAddress"
|
||||
ref="emailAddress"
|
||||
customInputId="emailAddress"
|
||||
:isRequired="!isEmailOptional"
|
||||
:validationRules="validationRules"
|
||||
:isEmailOptional="isEmailOptional" />
|
||||
validationRules="email-address-required|email-address-format" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-0">
|
||||
|
|
@ -81,7 +79,6 @@ export default {
|
|||
}),
|
||||
},
|
||||
validationRules: String,
|
||||
isEmailOptional: Boolean,
|
||||
},
|
||||
computed: {
|
||||
customerModel: {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { settleAllPromises } from "@/helpers/layout-helper.js";
|
|||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
import baseMixin from "../../mixins/base-mixin";
|
||||
import { vinLookupMethodSelections } from "@/constants/vin-lookup-method-selections.js";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
|
||||
// Mock our module for promises.
|
||||
jest.mock("@/helpers/layout-helper.js", () => ({
|
||||
settleAllPromises: jest.fn(),
|
||||
|
|
@ -273,24 +273,12 @@ function setupMocks({
|
|||
Answers: cmsAnswers,
|
||||
FunnelFooterWidget: FunnelFooterWidget,
|
||||
};
|
||||
const mockMixin = {
|
||||
methods: {
|
||||
getSettingValue: jest.fn((settingName) => {
|
||||
if (settingName === experimentSettings.IS_EMAIL_OPTIONAL) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
const apiPromise = Promise.resolve({ cmsContent });
|
||||
settleAllPromises.mockImplementation(() => apiPromise);
|
||||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||
|
||||
const mountOptions = getMountOptions({
|
||||
...mountOptionsMockData,
|
||||
mixins: [baseMixin, mockMixin],
|
||||
});
|
||||
const mountOptions = getMountOptions({ ...mountOptionsMockData, mixins: [baseMixin] });
|
||||
mountOptions["attachTo"] = document.body;
|
||||
|
||||
const wrapper = shallowMount(estimate, mountOptions);
|
||||
|
|
@ -298,5 +286,6 @@ function setupMocks({
|
|||
wrapper.vm.getZipCodeData = jest
|
||||
.fn()
|
||||
.mockReturnValue({ isValid: true, isServiceable: true, state: "OH" });
|
||||
|
||||
return { wrapper, apiPromise };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,10 +52,9 @@
|
|||
cmsWidgetName="EmailAddressQuestionWidget"
|
||||
v-model="emailAddress"
|
||||
inputId="emailAddress"
|
||||
:isRequired="!IsEmailOptional"
|
||||
isRequired
|
||||
disableAutoFill
|
||||
:validationRules="EmailValidationRules"
|
||||
:isEmailOptional="IsEmailOptional" />
|
||||
validationRules="email-address-required|email-address-format" />
|
||||
<textBlock cmsWidgetName="QuoteEmailTextBlockWidget" typeStyle="caption" />
|
||||
|
||||
<alert
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { nextTick } from "vue";
|
|||
import { storeActions } from "@/constants/store-actions";
|
||||
import { storeMutations } from "@/constants/store-mutations";
|
||||
import store from "@/store";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
|
||||
jest.mock("@/assets/img/loader.gif", () => "loader.gif");
|
||||
jest.mock("@/assets/img/windshield.png", () => "windshield.png");
|
||||
|
|
@ -692,22 +691,12 @@ function setupMocks({
|
|||
],
|
||||
};
|
||||
|
||||
const mockMixin = {
|
||||
methods: {
|
||||
getSettingValue: jest.fn((settingName) => {
|
||||
if (settingName === experimentSettings.IS_EMAIL_OPTIONAL) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}),
|
||||
},
|
||||
};
|
||||
const apiPromise = Promise.resolve(apiResponses);
|
||||
|
||||
settleAllPromises.mockImplementation(() => apiPromise);
|
||||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||
|
||||
const mountOptions = getMountOptions({ ...mountOptionsMockData, mixins: [mockMixin] });
|
||||
const mountOptions = getMountOptions(mountOptionsMockData);
|
||||
mountOptions["attachTo"] = document.body; // append wrapper to document.body to test DOM methods
|
||||
|
||||
const wrapper = shallowMount(licensePlateLookup, mountOptions);
|
||||
|
|
|
|||
|
|
@ -34,9 +34,7 @@
|
|||
cmsWidgetName="EmailAddressQuestionWidget"
|
||||
v-model="email"
|
||||
customInputId="email"
|
||||
:isRequired="!IsEmailOptional"
|
||||
:validationRules="EmailValidationRules"
|
||||
:isEmailOptional="IsEmailOptional" />
|
||||
validationRules="email-address-required|email-address-format" />
|
||||
|
||||
<textBlock cmsWidgetName="QuoteEmailTextBlockWidget" typeStyle="caption" />
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import vinLookup from "./vin-lookup.vue";
|
|||
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios.js";
|
||||
import { settleAllPromises } from "@/helpers/layout-helper.js";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
|
||||
import store from "@/store";
|
||||
|
||||
|
|
@ -379,11 +378,5 @@ function mockOutStubFunctions(wrapper) {
|
|||
const mockMixin = {
|
||||
methods: {
|
||||
getCmsContent: jest.fn(() => "placeholder CMS content"),
|
||||
getSettingValue: jest.fn((settingName) => {
|
||||
if (settingName === experimentSettings.IS_EMAIL_OPTIONAL) {
|
||||
return "true";
|
||||
}
|
||||
return "false";
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,9 +53,8 @@
|
|||
cmsWidgetName="EmailAddressQuestionWidget"
|
||||
v-model="emailAddress"
|
||||
customInputId="emailAddress"
|
||||
:isRequired="!IsEmailOptional"
|
||||
:validationRules="EmailValidationRules"
|
||||
:isEmailOptional="IsEmailOptional" />
|
||||
isRequired
|
||||
validationRules="email-address-required|email-address-format" />
|
||||
|
||||
<textBlock cmsWidgetName="QuoteEmailTextBlockWidget" typeStyle="caption" />
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,8 @@ import { storeActions } from "@/constants/store-actions.js";
|
|||
import store from "@/store";
|
||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||
import { saveSession } from "@/helpers/heritage-integration/order-helper.js";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
IsEmailOptional() {
|
||||
const emailOptional = this.getSettingValue(experimentSettings.IS_EMAIL_OPTIONAL);
|
||||
return emailOptional === "true";
|
||||
},
|
||||
EmailValidationRules() {
|
||||
return this.IsEmailOptional
|
||||
? "email-address-format"
|
||||
: "email-address-required|email-address-format";
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async navigateForwardWithSingleCarMatch() {
|
||||
const pageName = this.$options?.name;
|
||||
|
|
|
|||
Loading…
Reference in a new issue