Merge pull request #429 from Safelite/feature/richardson/SSR-677
vehicle damage updates
This commit is contained in:
commit
e5cd0a589a
3 changed files with 25 additions and 2 deletions
|
|
@ -74,7 +74,8 @@ export default {
|
||||||
return this.modelValue.includes(this.value);
|
return this.modelValue.includes(this.value);
|
||||||
}
|
}
|
||||||
if (!this.isMultiSelect) {
|
if (!this.isMultiSelect) {
|
||||||
return this.modelValue === this.value;
|
// eslint-disable-next-line eqeqeq
|
||||||
|
return this.modelValue == this.value;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { mount, flushPromises } from '@vue/test-utils';
|
||||||
import { createTestingPinia } from '@pinia/testing';
|
import { createTestingPinia } from '@pinia/testing';
|
||||||
import navigationScenarios from '@/router/router-constants/navigation-scenarios';
|
import navigationScenarios from '@/router/router-constants/navigation-scenarios';
|
||||||
import routerParams from '@/router/router-constants/router-params';
|
import routerParams from '@/router/router-constants/router-params';
|
||||||
|
import { useMainStore } from '@/store';
|
||||||
import vehicleCategories from '@/constants/vehicle-categories';
|
import vehicleCategories from '@/constants/vehicle-categories';
|
||||||
import VehicleDamageComponent from '@/layouts/vehicle-damage/vehicle-damage.vue';
|
import VehicleDamageComponent from '@/layouts/vehicle-damage/vehicle-damage.vue';
|
||||||
|
|
||||||
|
|
@ -69,6 +70,21 @@ describe('vehicle-damage.vue', () => {
|
||||||
const wrapper = mount(VehicleDamageComponent, mountOptions);
|
const wrapper = mount(VehicleDamageComponent, mountOptions);
|
||||||
const siteFooterWrapper = wrapper.getComponent({ ref: 'siteFooter' });
|
const siteFooterWrapper = wrapper.getComponent({ ref: 'siteFooter' });
|
||||||
|
|
||||||
|
useMainStore().getSupportingItems = jest.fn().mockImplementation(() => Promise.resolve({
|
||||||
|
data: { data: [
|
||||||
|
{
|
||||||
|
description: null,
|
||||||
|
partNumber: 'SUPPLIES-REPAIR',
|
||||||
|
partType: 'REPAIR FEE'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
description: null,
|
||||||
|
partNumber: 'WSREPAIR',
|
||||||
|
partType: 'REPAIR FEE'
|
||||||
|
}
|
||||||
|
] }
|
||||||
|
}));
|
||||||
|
|
||||||
siteFooterWrapper.vm.$emit('forwardClicked');
|
siteFooterWrapper.vm.$emit('forwardClicked');
|
||||||
|
|
||||||
await flushPromises();
|
await flushPromises();
|
||||||
|
|
|
||||||
|
|
@ -364,11 +364,17 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
await this.mainStore.saveVehicleDamage(
|
this.mainStore.saveVehicleDamage(
|
||||||
this.isWindshieldRepair,
|
this.isWindshieldRepair,
|
||||||
this.selectedGlassToReplace(),
|
this.selectedGlassToReplace(),
|
||||||
this.selectedWindshieldOptions.selectedWindshieldChipCount
|
this.selectedWindshieldOptions.selectedWindshieldChipCount
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.isWindshieldRepair) {
|
||||||
|
const supportingItems = await useMainStore().getSupportingItems();
|
||||||
|
this.mainStore.saveSupportingItems(supportingItems.data);
|
||||||
|
}
|
||||||
|
|
||||||
return this.navigateForward();
|
return this.navigateForward();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue