Merge branch 'develop' into feature/jnou/fix-playwright-pipeline
This commit is contained in:
commit
95c7eafbbf
8 changed files with 134 additions and 43 deletions
60
package-lock.json
generated
60
package-lock.json
generated
|
|
@ -3925,9 +3925,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@stylistic/eslint-plugin/node_modules/picomatch": {
|
"node_modules/@stylistic/eslint-plugin/node_modules/picomatch": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -4696,9 +4696,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||||
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
|
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -4842,7 +4842,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vitest/coverage-v8/node_modules/brace-expansion": {
|
"node_modules/@vitest/coverage-v8/node_modules/brace-expansion": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -7017,7 +7019,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/brace-expansion": {
|
"node_modules/brace-expansion": {
|
||||||
"version": "1.1.12",
|
"version": "1.1.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz",
|
||||||
|
"integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -8048,7 +8052,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cosmiconfig/node_modules/yaml": {
|
"node_modules/cosmiconfig/node_modules/yaml": {
|
||||||
"version": "1.10.2",
|
"version": "1.10.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz",
|
||||||
|
"integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -8341,7 +8347,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cssnano/node_modules/yaml": {
|
"node_modules/cssnano/node_modules/yaml": {
|
||||||
"version": "1.10.2",
|
"version": "1.10.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.3.tgz",
|
||||||
|
"integrity": "sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -8962,7 +8970,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/editorconfig/node_modules/brace-expansion": {
|
"node_modules/editorconfig/node_modules/brace-expansion": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -14668,7 +14678,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/js-beautify/node_modules/brace-expansion": {
|
"node_modules/js-beautify/node_modules/brace-expansion": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-MCV/fYJEbqx68aE58kv2cA/kiky1G8vux3OR6/jbS+jIMe/6fJWa0DTzJU7dqijOWYwHi1t29FlfYI9uytqlpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -16002,7 +16014,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-forge": {
|
"node_modules/node-forge": {
|
||||||
"version": "1.3.2",
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-LarFH0+6VfriEhqMMcLX2F7SwSXeWwnEAJEsYm5QKWchiVYVvJyV9v7UDvUv+w5HO23ZpQTXDv/GxdDdMyOuoQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "(BSD-3-Clause OR GPL-2.0)",
|
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -16739,7 +16753,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/path-to-regexp": {
|
"node_modules/path-to-regexp": {
|
||||||
"version": "0.1.12",
|
"version": "0.1.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz",
|
||||||
|
"integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
|
@ -16769,7 +16785,9 @@
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/picomatch": {
|
"node_modules/picomatch": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -19734,7 +19752,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tinyglobby/node_modules/picomatch": {
|
"node_modules/tinyglobby/node_modules/picomatch": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -20483,7 +20503,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vite/node_modules/picomatch": {
|
"node_modules/vite/node_modules/picomatch": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -20565,7 +20587,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vitest/node_modules/picomatch": {
|
"node_modules/vitest/node_modules/picomatch": {
|
||||||
"version": "4.0.3",
|
"version": "4.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
||||||
|
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,18 @@ const experimentSettings = Object.freeze({
|
||||||
ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1'
|
ISS_ENABLE_ADYEN_V1: 'ISS_Enable_Adyen_V1'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const experimentTest = Object.freeze({
|
||||||
|
ISS_MOBILE_FIRST_POPUP_V3: 'ISS_Mobile_First_Popup_V3'
|
||||||
|
});
|
||||||
|
|
||||||
|
const experimentVariation = Object.freeze({
|
||||||
|
ISS_MOBILE_FIRST_CONTROL_V3: 'NoShowMobileFirstPopUp_V3_CONTROL',
|
||||||
|
ISS_MOBILE_FIRST_TEST_V3: 'YesShowMobileFirstPopUp_V3_TEST'
|
||||||
|
});
|
||||||
|
|
||||||
const experimentTriggers = Object.freeze({
|
const experimentTriggers = Object.freeze({
|
||||||
SITE_ENTRY: 'SiteEntry',
|
SITE_ENTRY: 'SiteEntry',
|
||||||
PAGE_ENTRY: 'PageEntry'
|
PAGE_ENTRY: 'PageEntry'
|
||||||
});
|
});
|
||||||
|
|
||||||
export { experimentUniverses, experimentSettings, experimentTriggers };
|
export { experimentUniverses, experimentSettings, experimentTest, experimentVariation, experimentTriggers };
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,21 @@ export async function getZipCodeData(zipCode) {
|
||||||
return await processZipCodeResults(useMainStore().validateZip({ zip: zipCode }));
|
return await processZipCodeResults(useMainStore().validateZip({ zip: zipCode }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isServiceableMobileWithData(isGlassServiceableMobile, isRecalibrationServiceableMobile) {
|
||||||
|
const isBigTruck = useMainStore().order.serviceLocation.isBigTruck;
|
||||||
|
if (isBigTruck) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isRecalibrationServiceableMobile === true || isRecalibrationServiceableMobile === false) {
|
||||||
|
return (
|
||||||
|
isGlassServiceableMobile
|
||||||
|
&& isRecalibrationServiceableMobile
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return !!isGlassServiceableMobile;
|
||||||
|
}
|
||||||
|
|
||||||
export function mapTimeSlot(timeSlot, timeOfDay) {
|
export function mapTimeSlot(timeSlot, timeOfDay) {
|
||||||
return {
|
return {
|
||||||
...timeSlot,
|
...timeSlot,
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ import siteFooter from '@/iss-components/site-footer/site-footer.vue';
|
||||||
import suggestTimeslotModal from '@/layouts/schedule-page/suggest-timeslot-modal/suggest-timeslot-modal.vue';
|
import suggestTimeslotModal from '@/layouts/schedule-page/suggest-timeslot-modal/suggest-timeslot-modal.vue';
|
||||||
|
|
||||||
// Supporting files
|
// Supporting files
|
||||||
import { experimentSettings, experimentUniverses } from '@/constants/experiments';
|
import { experimentSettings, experimentTest, experimentVariation, experimentUniverses } from '@/constants/experiments';
|
||||||
import {
|
import {
|
||||||
AppointmentTypeStrings,
|
AppointmentTypeStrings,
|
||||||
GET_MOBILE_TIME_SLOTS,
|
GET_MOBILE_TIME_SLOTS,
|
||||||
|
|
@ -99,6 +99,7 @@ import {
|
||||||
getPricedMobileFeePart,
|
getPricedMobileFeePart,
|
||||||
getMobileZipCodeData,
|
getMobileZipCodeData,
|
||||||
getZipCodeData,
|
getZipCodeData,
|
||||||
|
isServiceableMobileWithData,
|
||||||
mapTimeSlot
|
mapTimeSlot
|
||||||
} from '@/helpers/service-location-helper';
|
} from '@/helpers/service-location-helper';
|
||||||
import { Form } from 'vee-validate';
|
import { Form } from 'vee-validate';
|
||||||
|
|
@ -337,7 +338,7 @@ export default {
|
||||||
mobileProviderNumber: resultMap.providers?.mobileProviderNumber,
|
mobileProviderNumber: resultMap.providers?.mobileProviderNumber,
|
||||||
serviceabilityDetails: resultMap.serviceabilityDetails,
|
serviceabilityDetails: resultMap.serviceabilityDetails,
|
||||||
zipCode: initialServiceLocationObj.zipCode
|
zipCode: initialServiceLocationObj.zipCode
|
||||||
}
|
};
|
||||||
|
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.$refs.serviceLocation.initializeComponent(serviceLocationData);
|
vm.$refs.serviceLocation.initializeComponent(serviceLocationData);
|
||||||
|
|
@ -492,13 +493,18 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
async checkMobileFirstExperience(mobileFirstObject = {}) {
|
async checkMobileFirstExperience(mobileFirstObject = {}) {
|
||||||
|
const mobileFirstExperimentVariation = this.getExperimentVariationNameByTestName(experimentTest.ISS_MOBILE_FIRST_POPUP_V3);
|
||||||
|
const isMobileFirstTestVariation = mobileFirstExperimentVariation === experimentVariation.ISS_MOBILE_FIRST_TEST_V3;
|
||||||
const showMobileFirst = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT);
|
const showMobileFirst = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_SHOW_FIRST_MOBILE_APPOINTMENT);
|
||||||
if (showMobileFirst) {
|
if (showMobileFirst) {
|
||||||
const pmMobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS);
|
const pmMobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_PM_MOBILE_DAYS);
|
||||||
const mobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_MOBILE_DAYS);
|
const mobileDaysLimit = this.getSettingValue(experimentSettings.ISS_MOBILE_FIRST_MAX_MOBILE_DAYS);
|
||||||
const hasSelectedDate = !!this.getSelectedDate();
|
const hasSelectedDate = !!this.getSelectedDate();
|
||||||
const isServicableMobile = mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile;
|
const isServiceableMobile = isServiceableMobileWithData(
|
||||||
if (!hasSelectedDate && isServicableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) {
|
mobileFirstObject.serviceabilityDetails?.isGlassServiceableMobile ?? null,
|
||||||
|
mobileFirstObject.serviceabilityDetails?.isRecalibrationServiceableMobile ?? null
|
||||||
|
);
|
||||||
|
if (!hasSelectedDate && isServiceableMobile && mobileFirstObject.mobileProviderNumber && mobileFirstObject.zipCode) {
|
||||||
const todayDateObject = new Date();
|
const todayDateObject = new Date();
|
||||||
const todayDateString = convertDateToDateString(todayDateObject);
|
const todayDateString = convertDateToDateString(todayDateObject);
|
||||||
const calendarViewDirection = 'future';
|
const calendarViewDirection = 'future';
|
||||||
|
|
@ -624,7 +630,11 @@ export default {
|
||||||
this.mainStore.logMobileFirstExperimentExposure();
|
this.mainStore.logMobileFirstExperimentExposure();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$refs[SUGGEST_TIMESLOT_MODAL_REF_NAME].openModal(timeSlotForAutoSelectionMobile);
|
if (isMobileFirstTestVariation) {
|
||||||
|
this.$refs[SUGGEST_TIMESLOT_MODAL_REF_NAME].openModal(timeSlotForAutoSelectionMobile);
|
||||||
|
} else {
|
||||||
|
console.log('In Control group or experiment not found, skip showing popup');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.isRecalibrationServiceableMobile !== null) {
|
if (this.isRecalibrationServiceableMobile === true || this.isRecalibrationServiceableMobile === false) {
|
||||||
return (
|
return (
|
||||||
this.isGlassServiceableMobile
|
this.isGlassServiceableMobile
|
||||||
&& this.isRecalibrationServiceableMobile
|
&& this.isRecalibrationServiceableMobile
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,17 @@ export default {
|
||||||
const experiment = useMainStore().applicationUser.experiments.find((e) => e.universeName === experimentName);
|
const experiment = useMainStore().applicationUser.experiments.find((e) => e.universeName === experimentName);
|
||||||
return experiment ? experiment : null;
|
return experiment ? experiment : null;
|
||||||
},
|
},
|
||||||
|
getExperimentByTestName(testName) {
|
||||||
|
const experiment = useMainStore().applicationUser.experiments.find((experiment) => experiment.testName === testName);
|
||||||
|
return experiment ? experiment : null;
|
||||||
|
},
|
||||||
|
getExperimentVariationNameByTestName(testName) {
|
||||||
|
const experimentByTestName = this.getExperimentByTestName(testName);
|
||||||
|
if (!experimentByTestName) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return experimentByTestName.variationName;
|
||||||
|
},
|
||||||
getSettingValue(settingName) {
|
getSettingValue(settingName) {
|
||||||
return this.hasSetting(settingName)
|
return this.hasSetting(settingName)
|
||||||
? useMainStore().experimentSettings[settingName]
|
? useMainStore().experimentSettings[settingName]
|
||||||
|
|
|
||||||
|
|
@ -1934,6 +1934,9 @@ export const useMainStore = defineStore({
|
||||||
this.updateMobileFee(fee);
|
this.updateMobileFee(fee);
|
||||||
} else if (fee.partNumber === partNumberStrings.RECYCLE_FEE) {
|
} else if (fee.partNumber === partNumberStrings.RECYCLE_FEE) {
|
||||||
this.updateRecycleFee(fee);
|
this.updateRecycleFee(fee);
|
||||||
|
} else if (fee.partNumber === partNumberStrings.LABOR2) {
|
||||||
|
// Do not add Labor2 to feeItems since it's already been added to supportingItems
|
||||||
|
this.addPartNumberFeeItem(null, partNumberStrings.LABOR2);
|
||||||
} else {
|
} else {
|
||||||
this.addPartNumberFeeItem(fee, fee.partNumber);
|
this.addPartNumberFeeItem(fee, fee.partNumber);
|
||||||
}
|
}
|
||||||
|
|
@ -1948,8 +1951,8 @@ export const useMainStore = defineStore({
|
||||||
// Process Recycle Fee
|
// Process Recycle Fee
|
||||||
this.updateRecycleFee(partsData.find((rf) => rf.partNumber === partNumberStrings.RECYCLE_FEE));
|
this.updateRecycleFee(partsData.find((rf) => rf.partNumber === partNumberStrings.RECYCLE_FEE));
|
||||||
|
|
||||||
// Remove RecycleFee and Labor2 from supporting items as they're saved in feeItems;
|
// Remove RecycleFee from supporting items since it's already been added to feeItems
|
||||||
this.order.lineItems.supportingItems = partsData.filter((i) => i.partNumber !== partNumberStrings.RECYCLE_FEE && i.partNumber !== partNumberStrings.LABOR2);
|
this.order.lineItems.supportingItems = partsData.filter((i) => i.partNumber !== partNumberStrings.RECYCLE_FEE);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateVaps(partsData) {
|
updateVaps(partsData) {
|
||||||
|
|
@ -2792,7 +2795,6 @@ export const useMainStore = defineStore({
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
updateContactInfo(contactInfo) {
|
updateContactInfo(contactInfo) {
|
||||||
this.order.customer.firstName = contactInfo?.firstName ?? this.order.customer.firstName;
|
this.order.customer.firstName = contactInfo?.firstName ?? this.order.customer.firstName;
|
||||||
this.order.customer.lastName = contactInfo?.lastName ?? this.order.customer.lastName;
|
this.order.customer.lastName = contactInfo?.lastName ?? this.order.customer.lastName;
|
||||||
|
|
|
||||||
|
|
@ -2490,16 +2490,12 @@ describe('Store', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('updateSupportingItems method', () => {
|
describe('updateSupportingItems method', () => {
|
||||||
it('updateSupportingItems removes Recyle Fee and Labor2 Fee from supporting items in store', () => {
|
it('updateSupportingItems removes Recycle Fee from supporting items in store', () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const partsData = [
|
const partsData = [
|
||||||
{
|
{
|
||||||
partNumber: 'RECYCLE FEE',
|
partNumber: 'RECYCLE FEE',
|
||||||
partType: 'REPLACE FEE'
|
partType: 'REPLACE FEE'
|
||||||
},
|
|
||||||
{
|
|
||||||
partNumber: 'LABOR2',
|
|
||||||
partType: 'NON_GLASS'
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -2507,14 +2503,38 @@ describe('Store', () => {
|
||||||
store.updateSupportingItems(partsData);
|
store.updateSupportingItems(partsData);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect.not.objectContaining({
|
expect(store.order.lineItems.supportingItems).not.toEqual(
|
||||||
partNumber: 'RECYCLE FEE',
|
expect.arrayContaining([
|
||||||
partType: 'REPLACE FEE'
|
expect.objectContaining({
|
||||||
});
|
partNumber: 'RECYCLE FEE',
|
||||||
expect.not.objectContaining({
|
partType: 'REPLACE FEE'
|
||||||
partNumber: 'LABOR2',
|
})
|
||||||
partType: 'NON_GLASS'
|
])
|
||||||
});
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('updateGlassFees method', () => {
|
||||||
|
it('updateGlassFees does not add Labor2 fee to feeItems', () => {
|
||||||
|
// Arrange
|
||||||
|
const feeData = [
|
||||||
|
{
|
||||||
|
partNumber: 'LABOR2',
|
||||||
|
partType: 'LABOR FEE'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// Act
|
||||||
|
store.updateGlassFees(feeData);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(store.order.lineItems.feeItems).not.toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
expect.objectContaining({
|
||||||
|
partNumber: 'LABOR2',
|
||||||
|
partType: 'LABOR FEE'
|
||||||
|
})
|
||||||
|
])
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Loading…
Reference in a new issue