Merge pull request #1089 from Safelite/feature/INSR-7750
Feature/insr 7750
This commit is contained in:
commit
56a59808e3
4 changed files with 27 additions and 29 deletions
|
|
@ -9,13 +9,12 @@
|
||||||
v-model="selectedAnswers"
|
v-model="selectedAnswers"
|
||||||
isRequired
|
isRequired
|
||||||
:isMetaValid="meta.valid"
|
:isMetaValid="meta.valid"
|
||||||
:alertFewMoreQuestionsHeader="AlertFewMoreQuestionsHeader"
|
|
||||||
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
|
||||||
:questionsData="questionsData"
|
:questionsData="questionsData"
|
||||||
:validationRules="rules.optionRequired"
|
:validationRules="rules.optionRequired"
|
||||||
:index="currentGlassIndex"
|
:index="currentGlassIndex"
|
||||||
@forwardButtonAction="forwardButtonAction"
|
@forwardButtonAction="forwardButtonAction"
|
||||||
@backClick="navigateBackByVehicleQuestions" />
|
@backClick="navigateBackByVehicleQuestions"
|
||||||
|
@needHelpClick="requestCallbackBailout" />
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -31,6 +30,8 @@ import { useMainStore } from '@/store';
|
||||||
import globalRules from '@/constants/global-rules';
|
import globalRules from '@/constants/global-rules';
|
||||||
import vehicleQuestionsMixin from '@/mixins/vehicle-questions-mixin';
|
import vehicleQuestionsMixin from '@/mixins/vehicle-questions-mixin';
|
||||||
import questionsPageLayout from '@/iss-components/questions-page-layout/questions-page-layout.vue';
|
import questionsPageLayout from '@/iss-components/questions-page-layout/questions-page-layout.vue';
|
||||||
|
import bailoutMessage from '@/constants/bailoutMessage';
|
||||||
|
import navigationScenarios from '@/router/router-constants/navigation-scenarios';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'capability-questions',
|
name: 'capability-questions',
|
||||||
|
|
@ -67,18 +68,6 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
AlertFewMoreQuestionsHeader() {
|
|
||||||
return this.getCmsContent(
|
|
||||||
'AdditionalPartsQuestionsAlert',
|
|
||||||
'HeadlineText'
|
|
||||||
);
|
|
||||||
},
|
|
||||||
AlertFewMoreQuestionsCopy() {
|
|
||||||
return this.getCmsContent(
|
|
||||||
'AdditionalPartsQuestionsAlert',
|
|
||||||
'BodyText'
|
|
||||||
);
|
|
||||||
},
|
|
||||||
partsOrQuestionsData() {
|
partsOrQuestionsData() {
|
||||||
return useMainStore().pageData(issPageValues.CAPABILITY_QUESTIONS)
|
return useMainStore().pageData(issPageValues.CAPABILITY_QUESTIONS)
|
||||||
.partsOrQuestions;
|
.partsOrQuestions;
|
||||||
|
|
@ -166,6 +155,10 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.navigateForward(this.partsOrQuestionsData, null);
|
this.navigateForward(this.partsOrQuestionsData, null);
|
||||||
|
},
|
||||||
|
requestCallbackBailout() {
|
||||||
|
this.mainStore.setBailout(bailoutMessage.RequestCallback());
|
||||||
|
this.$router.navigate(navigationScenarios.CLICKED_NEED_HELP_WITH_BAILOUT, this.$route);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,6 @@
|
||||||
v-model="selectedAnswers"
|
v-model="selectedAnswers"
|
||||||
isRequired
|
isRequired
|
||||||
:isMetaValid="meta.valid"
|
:isMetaValid="meta.valid"
|
||||||
:alertFewMoreQuestionsHeader="AlertFewMoreQuestionsHeader"
|
|
||||||
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
|
||||||
:questionsData="questionsData"
|
:questionsData="questionsData"
|
||||||
:validationRules="rules.optionRequired"
|
:validationRules="rules.optionRequired"
|
||||||
:index="currentGlassIndex"
|
:index="currentGlassIndex"
|
||||||
|
|
@ -71,18 +69,6 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
AlertFewMoreQuestionsHeader() {
|
|
||||||
return this.getCmsContent(
|
|
||||||
'AdditionalPartsQuestionsAlert',
|
|
||||||
'HeadlineText'
|
|
||||||
);
|
|
||||||
},
|
|
||||||
AlertFewMoreQuestionsCopy() {
|
|
||||||
return this.getCmsContent(
|
|
||||||
'AdditionalPartsQuestionsAlert',
|
|
||||||
'BodyText'
|
|
||||||
);
|
|
||||||
},
|
|
||||||
partsOrQuestionsData() {
|
partsOrQuestionsData() {
|
||||||
return useMainStore().pageData(issPageValues.MOLDING_QUESTIONS).partsOrQuestions;
|
return useMainStore().pageData(issPageValues.MOLDING_QUESTIONS).partsOrQuestions;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -330,6 +330,10 @@ const routingTable = () => [
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
|
scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
|
||||||
destinationIssPageValue: issPageValues.COVERAGE_STATEMENT
|
destinationIssPageValue: issPageValues.COVERAGE_STATEMENT
|
||||||
|
},
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_NEED_HELP_WITH_BAILOUT,
|
||||||
|
destinationIssPageValue: issPageValues.BAILOUT_PAGE
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -36,4 +36,19 @@ describe('Router', () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(router.push.mock.calls[0][0].state).toBe(parameters);
|
expect(router.push.mock.calls[0][0].state).toBe(parameters);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Should route from CAPABILITY_QUESTIONS to BAILOUT_PAGE on CLICKED_NEED_HELP_WITH_BAILOUT', () => {
|
||||||
|
const scenario = navigationScenarios.CLICKED_NEED_HELP_WITH_BAILOUT;
|
||||||
|
const currentRoute = { query: { issPage: issPageValues.CAPABILITY_QUESTIONS } };
|
||||||
|
|
||||||
|
router.push = jest.fn();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
router.navigate(scenario, currentRoute);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(router.push).toHaveBeenCalled();
|
||||||
|
|
||||||
|
expect(router.push.mock.calls[0][0].query.issPage).toBe(issPageValues.BAILOUT_PAGE);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue