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:
AHumphriesSL 2026-02-26 10:10:12 -05:00 committed by GitHub
commit d053faa132
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 4 deletions

View file

@ -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
});
});

View file

@ -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);

View file

@ -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';