Merge pull request #1115 from Safelite/feature/humphries/INSR-7759.1
Fix a couple defects found while testing payment-method
This commit is contained in:
commit
d053faa132
3 changed files with 32 additions and 4 deletions
|
|
@ -330,6 +330,30 @@ describe('contactDetails.vue', () => {
|
|||
navigate: jest.fn()
|
||||
}
|
||||
});
|
||||
const provider = {
|
||||
address: {
|
||||
city: getRandomString(4, 20),
|
||||
state: getRandomString(2, 2),
|
||||
streetAddress: getRandomString(10, 50),
|
||||
zipCode: getRandomInt(10000, 99999).toString(),
|
||||
zipCodeCtu: getRandomInt(10000, 99999).toString()
|
||||
},
|
||||
companyName: getRandomString(5, 15),
|
||||
phoneNumber: getRandomInt(1000000000, 9999999999).toString(),
|
||||
providerNumber: getRandomInt(100000, 999999).toString()
|
||||
}
|
||||
const mainInitialState = {
|
||||
order: {
|
||||
serviceLocation: {
|
||||
provider
|
||||
}
|
||||
}
|
||||
};
|
||||
mountOptions.global.plugins = [createTestingPinia({
|
||||
initialState: {
|
||||
main: mainInitialState
|
||||
}
|
||||
})];
|
||||
const wrapper = shallowMount(contactDetails, mountOptions);
|
||||
const address = getRandomString(10, 50);
|
||||
const address2 = getRandomString(0, 50);
|
||||
|
|
@ -354,7 +378,8 @@ describe('contactDetails.vue', () => {
|
|||
address,
|
||||
address2,
|
||||
city,
|
||||
isVehicleProtected
|
||||
isVehicleProtected,
|
||||
provider
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -245,11 +245,14 @@ export default {
|
|||
};
|
||||
useMainStore().updateContactInfo(contactInfo);
|
||||
|
||||
const provider = useMainStore().serviceLocation.provider;
|
||||
|
||||
useMainStore().updateServiceLocation({
|
||||
address: this.address,
|
||||
address2: this.address2,
|
||||
city: this.city,
|
||||
isVehicleProtected: this.isVehicleProtected || 'false'
|
||||
isVehicleProtected: this.isVehicleProtected || 'false',
|
||||
provider
|
||||
});
|
||||
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
groupName="chooseShop"
|
||||
textPosition="text-start"
|
||||
isRequired
|
||||
validationRules="option-required" />
|
||||
validationRules="provider-required" />
|
||||
<span class="service-zip-prompt">
|
||||
{{ serviceZipPrompt }}
|
||||
</span>
|
||||
|
|
@ -116,7 +116,7 @@ import errorMessages from '@/constants/error-messages';
|
|||
import { defineRule } from 'vee-validate';
|
||||
import { required } from '@/helpers/validation-rules';
|
||||
|
||||
defineRule('option-required', required(errorMessages.PROVIDER_REQUIRED));
|
||||
defineRule('provider-required', required(errorMessages.PROVIDER_REQUIRED));
|
||||
|
||||
const SERVICE_ZIP_QUESTION_REF_NAME = 'serviceZipCodeQuestion';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue