Trigger validation when autofilling address fields
This commit is contained in:
parent
e7b56be12d
commit
565bcb8394
2 changed files with 24 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue