Merge pull request #1433 from Safelite/CSR-1712-add-copy-to-vehicle-page

CSR-1712 add copy to vehicle page.
This commit is contained in:
bmauger 2023-10-20 10:23:25 -04:00 committed by GitHub
commit 43bfda937b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 13 deletions

View file

@ -5,12 +5,19 @@ import vehicle from "@/layouts/vehicle/vehicle.vue";
import { shallowMount } from "@vue/test-utils"; import { shallowMount } from "@vue/test-utils";
import { nextTick } from "vue"; import { nextTick } from "vue";
import { getMountOptions } from "@/helpers/unit-test-helper.js"; import { getMountOptions } from "@/helpers/unit-test-helper.js";
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import baseMixin from "../../mixins/base-mixin";
// Mock our module for promises. // Mock our module for promises.
jest.mock("@/helpers/layout-helper.js", () => ({ jest.mock("@/helpers/layout-helper.js", () => ({
settleAllPromises: jest.fn(), settleAllPromises: jest.fn(),
})); }));
// Mock fetchCmsContentForPage
jest.mock("@/helpers/cms-content-helper", () => ({
fetchCmsContentForPage: jest.fn(),
}));
describe("vehicle.vue", () => { describe("vehicle.vue", () => {
test("arePagePrerequisitesValid should be true ", async () => { test("arePagePrerequisitesValid should be true ", async () => {
//Arrange //Arrange
@ -40,17 +47,24 @@ describe("vehicle.vue", () => {
}); });
function setupMocks() { function setupMocks() {
const wrapper = shallowMount( const mountOptions = getMountOptions({
vehicle, router: {
getMountOptions({ navigate: jest.fn(),
router: { navigate: jest.fn(),
navigate: jest.fn(), navigateWithSaving: jest.fn(),
navigate: jest.fn(), navigateWithoutSaving: jest.fn(),
navigateWithSaving: jest.fn(), },
navigateWithoutSaving: jest.fn(), });
},
}) //Mock props
); const mockMixin = {
methods: {
getCmsContent: jest.fn(),
},
};
mountOptions.mixins = [mockMixin];
const wrapper = shallowMount(vehicle, mountOptions);
return { wrapper }; return { wrapper };
} }

View file

@ -9,6 +9,10 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6 col-xl-4"> <div class="col-md-6 col-xl-4">
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" class="siteSubHeader" /> <funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" class="siteSubHeader" />
<div
cmsWidgetName="FindYourVehicleCopyWidget"
v-html="this.findYourVehicleCopy"
class="mt-2 mb-4 small"></div>
<vehicleQuestion <vehicleQuestion
ref="vehicleYearQuestion" ref="vehicleYearQuestion"
v-model="selectedYear" v-model="selectedYear"
@ -294,6 +298,9 @@ export default {
else if (this.imageUrl == null && this.carId !== null) return false; else if (this.imageUrl == null && this.carId !== null) return false;
else return true; else return true;
}, },
findYourVehicleCopy() {
return this.getCmsContent("FindYourVehicleCopyWidget", "QuestionText");
},
}, },
methods: { methods: {
getVehicle(year, make, model, style) { getVehicle(year, make, model, style) {
@ -430,6 +437,6 @@ export default {
} }
.siteSubHeader { .siteSubHeader {
margin-top: 1.5rem; margin-top: 1.5rem;
margin-bottom: 1.5rem; margin-bottom: 0;
} }
</style> </style>

View file

@ -1,6 +1,6 @@
<template> <template>
<div <div
class="alert fade show text-center mb-0 py-2 px-4" class="alert fade show text-center mb-0 py-2 px-4 border-0"
role="alert" role="alert"
:class="[ :class="[
isDismissible ? 'alert-dismissible' : '', isDismissible ? 'alert-dismissible' : '',