CSR-762 Cleanup
This commit is contained in:
parent
b2a81875d2
commit
c70bbf665c
5 changed files with 6 additions and 12 deletions
|
|
@ -473,8 +473,6 @@ describe.skip("baseInputButton.vue", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO KO look at how I tested groups of these in SFA (making sure selecting one radio changes the value, etc, that this acts like a regular input aside from a different emitted event)
|
|
||||||
|
|
||||||
function setupMocks({ mockData = {}, shouldShallowMount = true }) {
|
function setupMocks({ mockData = {}, shouldShallowMount = true }) {
|
||||||
const baseInputButtonWrapper = {
|
const baseInputButtonWrapper = {
|
||||||
components: { baseInputButton },
|
components: { baseInputButton },
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonsInfo() {
|
buttonsInfo() {
|
||||||
// TODO KO temporary. It should always just be an array
|
|
||||||
return (Array.isArray(this.answers) ? this.answers : [])?.map(
|
return (Array.isArray(this.answers) ? this.answers : [])?.map(
|
||||||
(answer) => ({
|
(answer) => ({
|
||||||
buttonLabel: answer.buttonLabel ?? answer.Text ?? answer,
|
buttonLabel: answer.buttonLabel ?? answer.Text ?? answer,
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ export default ({
|
||||||
name: "sideDoorOptions",
|
name: "sideDoorOptions",
|
||||||
props: {
|
props: {
|
||||||
groupName: String,
|
groupName: String,
|
||||||
modelValue: [Array, Object], // TODO Does this take an array?
|
modelValue: Object,
|
||||||
selectedDamageLocations: Array,
|
selectedDamageLocations: Array,
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ defineRule("windshield-replace-options-required", required(errorMessages.WINSHIE
|
||||||
|
|
||||||
defineRule("check-for-repair-and-replace", (selectedWindshieldDamageType, selectedDamageLocations) => {
|
defineRule("check-for-repair-and-replace", (selectedWindshieldDamageType, selectedDamageLocations) => {
|
||||||
return selectedWindshieldDamageType.toString() != damageLocationsSelected.REPAIR ||
|
return selectedWindshieldDamageType.toString() != damageLocationsSelected.REPAIR ||
|
||||||
(!selectedDamageLocations.includes(damageLocationsSelected.WINDSHIELD) && !selectedDamageLocations[0]?.includes(damageLocationsSelected.WINDSHIELD)) ||
|
(!selectedDamageLocations.includes(damageLocationsSelected.WINDSHIELD) && !selectedDamageLocations[0]?.includes(damageLocationsSelected.WINDSHIELD)) ||
|
||||||
(selectedDamageLocations.length === 1 && selectedDamageLocations[0].length === 1);
|
(selectedDamageLocations[0].length === 1);
|
||||||
});
|
});
|
||||||
defineRule("repair-only", (value) => {
|
defineRule("repair-only", (value) => {
|
||||||
return value.toString() === damageLocationsSelected.REPAIR;
|
return value.toString() === damageLocationsSelected.REPAIR;
|
||||||
|
|
@ -83,7 +83,7 @@ export default ({
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
modelValue: [Object, String], // TODO Does this take a string?
|
modelValue: Object,
|
||||||
selectedDamageLocations: Array,
|
selectedDamageLocations: Array,
|
||||||
hasRepairReplaceConflict: Boolean,
|
hasRepairReplaceConflict: Boolean,
|
||||||
hasSplitSingleConflict: Boolean,
|
hasSplitSingleConflict: Boolean,
|
||||||
|
|
|
||||||
|
|
@ -1044,11 +1044,8 @@ export const actions = {
|
||||||
);
|
);
|
||||||
const isWindshieldRepairTheSame =
|
const isWindshieldRepairTheSame =
|
||||||
isWindshieldRepair === context.state.order.damage.isRepair;
|
isWindshieldRepair === context.state.order.damage.isRepair;
|
||||||
const isChipCountTheSame = Array.isArray(selectedWindshieldChipCount) //TODO: fix the underlying components so this is never an array
|
|
||||||
? selectedWindshieldChipCount[0] ===
|
const isChipCountTheSame = selectedWindshieldChipCount === context.state.order.damage.numberOfChips;
|
||||||
context.state.order.damage.numberOfChips
|
|
||||||
: selectedWindshieldChipCount ===
|
|
||||||
context.state.order.damage.numberOfChips;
|
|
||||||
|
|
||||||
const isDamageChanging =
|
const isDamageChanging =
|
||||||
!isGlassToReplaceTheSame ||
|
!isGlassToReplaceTheSame ||
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue