Fixing bug in implementation

This commit is contained in:
Michaela Brydon 2024-07-01 12:13:18 -04:00
parent b21a3d8258
commit 5d07842a6a
2 changed files with 5 additions and 3 deletions

View file

@ -277,6 +277,7 @@ describe('capabilityQuestions.vue', () => {
wrapper.unmount();
});
// TODO add test spying on getPartFromCapQuestionAnswer
test('Should save to pinia store', async () => {
// Arrange
const { wrapper } = setupMocks({});

View file

@ -154,9 +154,10 @@ export default {
// set recalibration properties of parts based on capability question answers
for (let answer of questionAnswersArray) {
let partAssociatedWithAnswer = this.partsOrQuestionsData.find((x) => x.glassLocation === answer.glassLocation).parts[0];
partAssociatedWithAnswer = await useMainStore().getPartFromCapabilityQuestionAnswer(partAssociatedWithAnswer, answer);
console.log(JSON.stringify(partAssociatedWithAnswer));
const partData = this.partsOrQuestionsData.find((x) => x.glassLocation === answer.glassLocation);
if (partData) {
partData.parts[0] = await useMainStore().getPartFromCapabilityQuestionAnswer(partData.parts[0], answer);
}
}
this.navigateForward(this.partsOrQuestionsData, null);