Fix merge conflicts
This commit is contained in:
parent
efa77a2568
commit
5cd1b06478
1 changed files with 66 additions and 0 deletions
|
|
@ -41,6 +41,72 @@ describe("address-questions.vue", () => {
|
||||||
const alerts = wrapper.findAllComponents(alert);
|
const alerts = wrapper.findAllComponents(alert);
|
||||||
expect(alerts.length).toEqual(0);
|
expect(alerts.length).toEqual(0);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("Should render addressQuestions sub-components (textbox-questions and dropdown-questions)", async () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const streetAddress = wrapper.findComponent({ ref: 'autocomplete' });
|
||||||
|
const city = wrapper.findComponent({ ref: 'city' });
|
||||||
|
const state = wrapper.findComponent({ ref: 'state' });
|
||||||
|
const zipCode = wrapper.findComponent({ ref: 'zipCode' });
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(streetAddress.exists()).toBe(true);
|
||||||
|
expect(city.exists()).toBe(true);
|
||||||
|
expect(state.exists()).toBe(true);
|
||||||
|
expect(zipCode.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Should set this.displayNoMatchWarning to false when it is set to true, if the model if prepopulated", async () => {
|
||||||
|
// Arrange
|
||||||
|
const newAddressModel = {
|
||||||
|
streetAddress: "foo",
|
||||||
|
city: "foo",
|
||||||
|
state: "foo",
|
||||||
|
zipCode: "55555",
|
||||||
|
};
|
||||||
|
const wrapper = shallowMount(addressQuestions, {
|
||||||
|
propsData: {
|
||||||
|
modelValue: newAddressModel,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
await wrapper.setData({
|
||||||
|
displayNoMatchWarning: true
|
||||||
|
})
|
||||||
|
expect(wrapper.vm.displayNoMatchWarning).toBeTruthy();
|
||||||
|
|
||||||
|
// Act
|
||||||
|
wrapper.vm.$options.watch.addressModel.handler.call(wrapper.vm, wrapper.vm.addressModel);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.displayNoMatchWarning).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Should it set this.showAddressFields to true when the model is prepopulated", async () => {
|
||||||
|
// Arrange
|
||||||
|
// Act
|
||||||
|
const newAddressModel = {
|
||||||
|
streetAddress: "foo",
|
||||||
|
city: "foo",
|
||||||
|
state: "foo",
|
||||||
|
zipCode: "55555",
|
||||||
|
};
|
||||||
|
const wrapper = shallowMount(addressQuestions, {
|
||||||
|
propsData: {
|
||||||
|
modelValue: newAddressModel,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
wrapper.vm.setupAddressLookup();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.showAddressFields).toBe(true);
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("happy paths", () => {
|
describe("happy paths", () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue