Merge pull request #42 from Safelite/feature/Digital/SSR-87
Feature/digital/ssr 87
This commit is contained in:
commit
94083453f2
7 changed files with 13 additions and 21 deletions
|
|
@ -85,7 +85,7 @@ describe("vehicle-make.vue", () => {
|
|||
|
||||
});
|
||||
|
||||
test("Year set, arePagePrerequisitesValid should be true ", async () => {
|
||||
test("Year set, arePagePrerequisitesValid should be true ", () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
useMainStore().order.vehicle.year = 2001;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ describe("vehicle-model.vue", () => {
|
|||
});
|
||||
|
||||
describe("vehicle-model.vue", () => {
|
||||
test("Make set, arePagePrerequisitesValid should be true ", async () => {
|
||||
test("Make set, arePagePrerequisitesValid should be true ", () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
useMainStore().order.vehicle.make = "Honda";
|
||||
|
|
@ -100,7 +100,6 @@ describe("vehicle-model.vue", () => {
|
|||
);
|
||||
|
||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
await nextTick();
|
||||
|
||||
//Assert
|
||||
expect(arePagePrerequisitesValid).toBe(true);
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ jest.mock("@/helpers/cms-content-helper", () => ({
|
|||
}));
|
||||
|
||||
describe("vehicle-style.vue", () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
test("Style question component is initized with api data", async () => {
|
||||
//Arrange
|
||||
|
|
@ -87,25 +84,18 @@ describe("vehicle-style.vue", () => {
|
|||
});
|
||||
});
|
||||
|
||||
test("Model set, arePagePrerequisitesValid should be true ", async () => {
|
||||
test("Model set, arePagePrerequisitesValid should be true ", () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
useMainStore().order.vehicle = { year: 2011, make: "ford", model: "mustang", style: null }
|
||||
|
||||
//Act
|
||||
vehicleStyle.beforeRouteEnter.call(
|
||||
wrapper.vm,
|
||||
{ query: { issPage: "vehicle-style" } },
|
||||
undefined,
|
||||
(c) => c(wrapper.vm)
|
||||
);
|
||||
|
||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
await nextTick();
|
||||
const arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
|
||||
//Assert
|
||||
expect(arePagePrerequisitesValid).toBe(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function setupMocks({
|
||||
|
|
@ -150,6 +140,6 @@ function setupMocks({
|
|||
styleQuestion.methods.initializeComponent;
|
||||
|
||||
wrapper.vm.setCmsContent = baseMixin.methods.setCmsContent;
|
||||
|
||||
|
||||
return { wrapper, apiPromise };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ describe("vehicle-year.vue", () => {
|
|||
});
|
||||
|
||||
describe("vehicle-year.vue", () => {
|
||||
test("arePagePrerequisitesValid should be true ", async () => {
|
||||
test("arePagePrerequisitesValid should be true ", () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -64,7 +64,6 @@ describe("vehicle-year.vue", () => {
|
|||
);
|
||||
|
||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
await nextTick();
|
||||
|
||||
//Assert
|
||||
expect(arePagePrerequisitesValid).toBe(true);
|
||||
|
|
|
|||
|
|
@ -198,7 +198,7 @@ export const useMainStore = defineStore({
|
|||
payload: {},
|
||||
})
|
||||
.then((response) => {
|
||||
updateVehicle(response.vehicle);
|
||||
this.updateVehicle(response.data);
|
||||
return response;
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useMainStore } from "./@store";
|
||||
import { useMainStore } from '@/store';
|
||||
import { createApp } from 'vue';
|
||||
import { createPinia } from "pinia";
|
||||
import globalMethods from "@/global-methods";
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ describe("alert.vue", () => {
|
|||
isDismissible: true,
|
||||
manualHeadline: "testHeader",
|
||||
manualCopy: "testCopy",
|
||||
cmsWidgetName: "alert",
|
||||
},
|
||||
})
|
||||
);
|
||||
|
|
@ -31,6 +32,7 @@ describe("alert.vue", () => {
|
|||
alertClass: "warning",
|
||||
manualHeadline: "testHeader",
|
||||
manualCopy: "testCopy",
|
||||
cmsWidgetName: "alert",
|
||||
},
|
||||
})
|
||||
);
|
||||
|
|
@ -57,6 +59,7 @@ describe("alert.vue", () => {
|
|||
propsData: {
|
||||
manualHeadline: "testHeader",
|
||||
manualCopy: "testCopy with a {routerLink: testName, testLink} inside of it",
|
||||
cmsWidgetName: "alert",
|
||||
},
|
||||
stubs: ["router-link"],
|
||||
})
|
||||
|
|
@ -74,6 +77,7 @@ describe("alert.vue", () => {
|
|||
manualHeadline: "testHeader",
|
||||
manualCopy:
|
||||
"<p>testCopy with a {routerLink: testName, testLink} inside of it</p><p>and two paragraphs</p>",
|
||||
cmsWidgetName: "alert",
|
||||
},
|
||||
stubs: ["router-link"],
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue