CSR-2195 | Formatting and unit test fix
This commit is contained in:
parent
6f48f0ae4d
commit
1daaa863bf
3 changed files with 29 additions and 46 deletions
|
|
@ -1123,42 +1123,6 @@ describe("baseInputButton.vue", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("buttonId", () => {
|
|
||||||
test("groupName and value combo yield correct id for input button with string value", () => {
|
|
||||||
// Arrange/Act
|
|
||||||
const { wrapper } = setupMocks({
|
|
||||||
mockData: {
|
|
||||||
propsData: {
|
|
||||||
groupName: "my test-name",
|
|
||||||
value: "Aaa-BBB CcC",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
const inputElement = wrapper.find("input");
|
|
||||||
expect(wrapper.vm.buttonId).toBe("my-test-name-Aaa-BBB-CcC");
|
|
||||||
expect(inputElement.attributes().id).toBe("my-test-name-Aaa-BBB-CcC");
|
|
||||||
});
|
|
||||||
|
|
||||||
test("groupName and value combo yield correct id for input button with number value", () => {
|
|
||||||
// Arrange/Act
|
|
||||||
const { wrapper } = setupMocks({
|
|
||||||
mockData: {
|
|
||||||
propsData: {
|
|
||||||
groupName: "my test-name",
|
|
||||||
value: 2,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
const inputElement = wrapper.find("input");
|
|
||||||
expect(wrapper.vm.buttonId).toBe("my-test-name-2");
|
|
||||||
expect(inputElement.attributes().id).toBe("my-test-name-2");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("inputType", () => {
|
describe("inputType", () => {
|
||||||
test("isMultiSelect is true => inputType is 'checkbox'", () => {
|
test("isMultiSelect is true => inputType is 'checkbox'", () => {
|
||||||
// Arrange/Act
|
// Arrange/Act
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
valueToEmit: null,
|
valueToEmit: null,
|
||||||
buttonId: uuidv4()
|
buttonId: uuidv4(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ export default {
|
||||||
selectedDoorSides: [],
|
selectedDoorSides: [],
|
||||||
selectedDriverSideReplaceOptions: [],
|
selectedDriverSideReplaceOptions: [],
|
||||||
selectedPassengerSideReplaceOptions: [],
|
selectedPassengerSideReplaceOptions: [],
|
||||||
}
|
};
|
||||||
} else {
|
} else {
|
||||||
if (!this.isDriverSideReplace) {
|
if (!this.isDriverSideReplace) {
|
||||||
this.sideDoorOptionsData.selectedDriverSideReplaceOptions = [];
|
this.sideDoorOptionsData.selectedDriverSideReplaceOptions = [];
|
||||||
|
|
@ -202,8 +202,8 @@ export default {
|
||||||
this.selectedWindshieldOptions = {
|
this.selectedWindshieldOptions = {
|
||||||
selectedWindshieldDamageType: "",
|
selectedWindshieldDamageType: "",
|
||||||
selectedWindshieldChipCount: null,
|
selectedWindshieldChipCount: null,
|
||||||
selectedWindshieldReplaceOptions: []
|
selectedWindshieldReplaceOptions: [],
|
||||||
}
|
};
|
||||||
} else {
|
} else {
|
||||||
if (!this.isWindshieldRepair) {
|
if (!this.isWindshieldRepair) {
|
||||||
this.selectedWindshieldOptions.selectedWindshieldChipCount = null;
|
this.selectedWindshieldOptions.selectedWindshieldChipCount = null;
|
||||||
|
|
@ -615,25 +615,39 @@ export default {
|
||||||
return this.$store.getters.requiresVerifiedRedirecting;
|
return this.$store.getters.requiresVerifiedRedirecting;
|
||||||
},
|
},
|
||||||
isContinueEnabled() {
|
isContinueEnabled() {
|
||||||
return this.isAnyDamageSelected && this.isWindshieldValid && this.isRearGlassValid && this.isSideGlassValid;
|
return (
|
||||||
|
this.isAnyDamageSelected &&
|
||||||
|
this.isWindshieldValid &&
|
||||||
|
this.isRearGlassValid &&
|
||||||
|
this.isSideGlassValid
|
||||||
|
);
|
||||||
},
|
},
|
||||||
isAnyDamageSelected() {
|
isAnyDamageSelected() {
|
||||||
return this.selectedDamageLocations != null && this.selectedDamageLocations.length != 0;
|
return this.selectedDamageLocations != null && this.selectedDamageLocations.length != 0;
|
||||||
},
|
},
|
||||||
isSideGlassValid() {
|
isSideGlassValid() {
|
||||||
if (this.isSideDoorDamageLocation) {
|
if (this.isSideDoorDamageLocation) {
|
||||||
if (this.sideDoorOptionsData.selectedDoorSides == null || this.sideDoorOptionsData.selectedDoorSides == 0) {
|
if (
|
||||||
|
this.sideDoorOptionsData.selectedDoorSides == null ||
|
||||||
|
this.sideDoorOptionsData.selectedDoorSides == 0
|
||||||
|
) {
|
||||||
// SideDoor is selected, but "which side" question is unanswered
|
// SideDoor is selected, but "which side" question is unanswered
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (this.isPassengerSideReplace) {
|
if (this.isPassengerSideReplace) {
|
||||||
if (this.sideDoorOptionsData.selectedPassengerSideReplaceOptions == null || this.sideDoorOptionsData.selectedPassengerSideReplaceOptions.length == 0) {
|
if (
|
||||||
|
this.sideDoorOptionsData.selectedPassengerSideReplaceOptions == null ||
|
||||||
|
this.sideDoorOptionsData.selectedPassengerSideReplaceOptions.length == 0
|
||||||
|
) {
|
||||||
// PassengerSide is selected, but no sub option is
|
// PassengerSide is selected, but no sub option is
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isDriverSideReplace) {
|
if (this.isDriverSideReplace) {
|
||||||
if (this.sideDoorOptionsData.selectedDriverSideReplaceOptions == null || this.sideDoorOptionsData.selectedDriverSideReplaceOptions.length == 0) {
|
if (
|
||||||
|
this.sideDoorOptionsData.selectedDriverSideReplaceOptions == null ||
|
||||||
|
this.sideDoorOptionsData.selectedDriverSideReplaceOptions.length == 0
|
||||||
|
) {
|
||||||
// DriverSide is selected, but no sub option is
|
// DriverSide is selected, but no sub option is
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -669,7 +683,12 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.selectedWindshieldOptions.selectedWindshieldReplaceOptions == null || this.selectedWindshieldOptions.selectedWindshieldReplaceOptions.length == 0) {
|
if (
|
||||||
|
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions ==
|
||||||
|
null ||
|
||||||
|
this.selectedWindshieldOptions.selectedWindshieldReplaceOptions
|
||||||
|
.length == 0
|
||||||
|
) {
|
||||||
// Replace selected but follow-up split/single question not answered
|
// Replace selected but follow-up split/single question not answered
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -682,7 +701,7 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
selectedDamageLocations() {
|
selectedDamageLocations() {
|
||||||
this.clearChildEntries();
|
this.clearChildEntries();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue