Merge pull request #2041 from Safelite/feature/csr-2231

Trigger validation when autofilling address fields
This commit is contained in:
chloeherdsafelite 2024-10-23 11:50:17 -04:00 committed by GitHub
commit a8eb5b7453
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

@ -602,6 +602,24 @@ function setupMocks({
if (props) resultingMountOptions.propsData = props;
if (isShallowMount) {
resultingMountOptions.global.stubs = {
...(resultingMountOptions.global.stubs ?? {}),
textboxQuestion: {
template: `<span></span>`,
methods: {
handleChange: jest.fn(),
},
},
dropdownQuestion: {
template: `<span></span>`,
methods: {
handleChange: jest.fn(),
},
},
};
}
const wrapper = isShallowMount
? shallowMount(addressQuestions, resultingMountOptions)
: mount(addressQuestions, resultingMountOptions);

View file

@ -371,6 +371,12 @@ export default {
self.addressModel.state = state;
self.addressModel.zipCode = zipCode;
this.$refs.autocomplete.handleChange(streetNumber);
this.$refs.apartmentNumberOrBusinessName.handleChange(route);
this.$refs.city.handleChange(city);
this.$refs.state.handleChange(state);
this.$refs.zipCode.handleChange(zipCode);
if (!this.displayVerificationWarning) {
this.displayVerificationWarning = place.partial_match || !isAddressComplete;
}