Checking in before writing some unit tests
This commit is contained in:
parent
e583a903a1
commit
52e5c7d532
5 changed files with 36 additions and 7 deletions
|
|
@ -70,6 +70,10 @@ const endpoints = {
|
||||||
url: "/parts/api/v1/parts/rain-defense",
|
url: "/parts/api/v1/parts/rain-defense",
|
||||||
method: "GET",
|
method: "GET",
|
||||||
},
|
},
|
||||||
|
GetMobileFeePart: {
|
||||||
|
url: "/parts/api/v1/parts/mobile-fee",
|
||||||
|
method: "GET",
|
||||||
|
},
|
||||||
GetSupportingItems: {
|
GetSupportingItems: {
|
||||||
url: "/parts/api/v1/parts/supporting-items",
|
url: "/parts/api/v1/parts/supporting-items",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ const storeActions = {
|
||||||
GET_CAPABILITY_QUESTIONS: "getCapabilityQuestions",
|
GET_CAPABILITY_QUESTIONS: "getCapabilityQuestions",
|
||||||
GET_PART_FROM_CAPABILITY_QUESTION_ANSWER: "getPartFromCapabilityQuestionAnswer",
|
GET_PART_FROM_CAPABILITY_QUESTION_ANSWER: "getPartFromCapabilityQuestionAnswer",
|
||||||
GET_MOLDING_QUESTIONS: "getMoldingQuestions",
|
GET_MOLDING_QUESTIONS: "getMoldingQuestions",
|
||||||
|
GET_MOBILE_FEE_PART: "getMobileFeePart",
|
||||||
SAVE_SESSION: "saveSession",
|
SAVE_SESSION: "saveSession",
|
||||||
LOAD_SESSION: "loadSession",
|
LOAD_SESSION: "loadSession",
|
||||||
UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE: "updateStoreWithSaveSessionResponse",
|
UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE: "updateStoreWithSaveSessionResponse",
|
||||||
|
|
|
||||||
|
|
@ -76,9 +76,7 @@ export default {
|
||||||
includeSearchIcon: Boolean,
|
includeSearchIcon: Boolean,
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const inputId = !props.customInputId
|
const inputId = !props.customInputId ? `input-${crypto.randomUUID()}` : props.customInputId;
|
||||||
? `input-${crypto.randomUUID()}`
|
|
||||||
: props.customInputId;
|
|
||||||
|
|
||||||
const propsClone = Object.assign({}, props);
|
const propsClone = Object.assign({}, props);
|
||||||
const modelValue = propsClone.modelValue;
|
const modelValue = propsClone.modelValue;
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,8 @@ import alert from "@/ux-components/alert/alert";
|
||||||
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
import addressQuestions from "@/layouts/address-lookup/customer-questions/address-questions/address-questions";
|
||||||
import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question";
|
import vehicleProtectedQuestion from "@/layouts/service-location/mobile-location-modal-questions/vehicle-protected-question/vehicle-protected-question";
|
||||||
import textBlock from "@/digital-components/text-block/text-block";
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "mobile-location-modal-questions",
|
name: "mobile-location-modal-questions",
|
||||||
|
|
@ -61,7 +63,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
internalModel: this.copyModel(this.modelValue),
|
internalModel: this.copyModel(this.modelValue),
|
||||||
displayInvalidZipAlert: false,
|
displayInvalidZipAlert: false,
|
||||||
mobileFee: this.getMobileFee(),
|
mobileFee: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
|
@ -88,6 +90,9 @@ export default {
|
||||||
alertNonServiceableZipWidgetName: String,
|
alertNonServiceableZipWidgetName: String,
|
||||||
alertInvalidZipWidgetName: String,
|
alertInvalidZipWidgetName: String,
|
||||||
},
|
},
|
||||||
|
async mounted() {
|
||||||
|
this.mobileFee = await this.getMobileFee();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
mobileFeeText() {
|
mobileFeeText() {
|
||||||
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
|
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
|
||||||
|
|
@ -142,10 +147,24 @@ export default {
|
||||||
isZipServiceableInShop: modelToCopy.isZipServiceableInShop,
|
isZipServiceableInShop: modelToCopy.isZipServiceableInShop,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async getMobileFee() {
|
||||||
|
// Get the Mobile Fee Part
|
||||||
|
const mobileFeePart = await baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.GET_MOBILE_FEE_PART,
|
||||||
|
null,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Get the Mobile Fee Part Price
|
||||||
|
const pricingResults = await baseMixin.methods.dispatchStoreAction(
|
||||||
|
storeActions.PRICE_ORDER_ITEMS,
|
||||||
|
[ mobileFeePart.data ],
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
return await baseMixin.methods.getTotalLineItemPrice(pricingResults[0]);
|
||||||
|
|
||||||
getMobileFee() {
|
|
||||||
// TODO: Call new service endpoint to get the Mobile Fee price
|
|
||||||
return "34.99";
|
|
||||||
},
|
},
|
||||||
|
|
||||||
openModal() {
|
openModal() {
|
||||||
|
|
|
||||||
|
|
@ -907,6 +907,13 @@ export const actions = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getMobileFeePart(context) {
|
||||||
|
return globalMethods.callMockHttpClient({
|
||||||
|
method: endpoints.GetMobileFeePart.method,
|
||||||
|
endpoint: "https://run.mocky.io/v3/795de4cb-d014-48b4-9338-dab33261adce", //TODO: Remove Mocky Endpoint
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
getSupportingItems(context) {
|
getSupportingItems(context) {
|
||||||
const glassPartsArray = context.getters.lineItems.glassParts ?? [];
|
const glassPartsArray = context.getters.lineItems.glassParts ?? [];
|
||||||
const carId = context.getters.vehicle.carId;
|
const carId = context.getters.vehicle.carId;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue