Merge pull request #886 from Safelite/feature/richardson/SSR-1709

Commit for draft comparison
This commit is contained in:
brich1212safe 2024-10-31 11:39:49 -04:00 committed by GitHub
commit 6ef4087b8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 12 deletions

View file

@ -16,7 +16,8 @@ import coverageType from '@/constants/coverage-type';
// Mock so it can be used as an assertion
jest.mock('@/helpers/order-helper.js', () => ({
submitWorkOrder: jest.fn()
submitWorkOrder: jest.fn(),
saveSession: jest.fn()
}));
function setupMocks({ customMountOptions = {}, queryString }, mainInitialState = {}, customMixin = null) {
@ -319,14 +320,8 @@ describe('payment-method.vue', () => {
describe('forwardButtonAction', () => {
test('Pay at the time of service is selected, should call saveWorkOrder', async () => {
// Arrange
const store = {
order: {
payment: {
paymentMethod: paymentMethods.PAY_AT_TIME_OF_SERVICE
}
}
};
const wrapper = setupMocks({}, store);
const wrapper = setupMocks({});
wrapper.vm.paymentMethod = paymentMethods.PAY_AT_TIME_OF_SERVICE;
// Act
await wrapper.vm.forwardButtonAction();

View file

@ -127,12 +127,13 @@ export default {
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.initializeComponent();
vm.updateFooterButtonText(vm.customCallToActionButtonCopy);
});
},
data() {
return {
paymentMethod: this.getPaymentMethodFromStore(),
paymentMethod: null,
widget: {
paymentMethod: 'PaymentMethodWidget',
paymentMethodApplePay: 'PaymentMethodWidgetApplePay'
@ -251,8 +252,10 @@ export default {
&& serviceLocationReqs
&& scheduleReqs
&& customerReqs
&& contactInfoReqs
);
&& contactInfoReqs);
},
initializeComponent() {
this.paymentMethod = this.getPaymentMethodFromStore();
},
getPaymentMethodFromStore() {
if (this.isPayInAdvanceDisabled) {