Merge branch 'develop' into feature/Digital/SSR-454

This commit is contained in:
sheena 2023-05-08 15:35:45 +05:30
commit 5dc5dbe0c6
4 changed files with 11 additions and 17 deletions

View file

@ -36,7 +36,8 @@ const errorMessages = {
DAMAGE_OPTION_REQUIRED: "Please select an option",
POLICYHOLDER_FIRST_NAME_REQUIRED: "Please enter the policyholder first name",
POLICYHOLDER_LAST_NAME_REQUIRED: "Please enter the policyholder last name"
POLICYHOLDER_LAST_NAME_REQUIRED: "Please enter the policyholder last name",
ACKNOWLEDGEMENT_REQUIRED: "You must agree to the terms to continue"
};

View file

@ -83,7 +83,7 @@ describe("glass-part-question.vue", () => {
},
],
};
const { wrapper } = setupMocks(featureListData);
//Act
@ -94,7 +94,7 @@ describe("glass-part-question.vue", () => {
await wrapper.setData({ selectedTint: "Green Tint" });
// to trigger the computed setter
wrapper.vm.selectedPartNumber = "DB12209GTYN";
//Assert
expect(wrapper.emitted()["update:modelValue"][0]).toEqual([
{ partNumber: "DB12209GTYN", color: "Green Tint" },

View file

@ -50,6 +50,7 @@ import { errorMessages } from "@/constants/error-messages";
export default {
name: "glass-part-question",
emits: ["update:modelValue"],
inheritAttrs: false,
data() {
return {
@ -117,10 +118,8 @@ export default {
return this.modelValue?.partNumber;
},
set(newValue) {
this.$emit(
"update:modelValue",
this.partsForSelectedTint.filter((part) => part.partNumber == newValue.value)[0]
);
const part = this.partsForSelectedTint.filter((part) => part.partNumber == newValue?.value)[0];
this.$emit("update:modelValue", part);
},
},
@ -181,13 +180,6 @@ export default {
return tintSourceObject.src;
},
// Reset selections when tint changes for the same glass to ensure proper selection.
// Also checks if only a single part is present for the tint.
ResetTintAndPartSelections() {
this.selectedPartNumber = null;
this.AutoSelectIfSinglePart();
},
AutoSelectIfSinglePart() {
if (this.partsForSelectedTint?.length > 0)
{
@ -202,6 +194,9 @@ export default {
radioInput?.click();
});
}
else {
this.selectedPartNumber = null;
}
}
},

View file

@ -108,9 +108,7 @@ data() {
},
computed: {
isForwardActionDisabled() {
return (
this.selectedGlassPartNumbers.length !== this.PartsFromApi.partsOrQuestions.length
);
return this.selectedGlassPartNumbers.length !== this.PartsFromApi.partsOrQuestions.length
},
selectedGlassPartNumbers() {
// Compile all selected parts from the page.