Update unit tests for appointment-type-question
This commit is contained in:
parent
a74b361935
commit
937b6c3c47
1 changed files with 34 additions and 2 deletions
|
|
@ -59,7 +59,7 @@ afterEach(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("appointment-type-question.vue", () => {
|
describe("appointment-type-question.vue", () => {
|
||||||
it("Should display all options if both in-shop and mobile are available", async () => {
|
it("Should display all options if in-shop, mobile, and dropoff are available", async () => {
|
||||||
// Arrange/Act
|
// Arrange/Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
|
|
@ -67,6 +67,7 @@ describe("appointment-type-question.vue", () => {
|
||||||
cmsWidgetName: cmsWidgetName,
|
cmsWidgetName: cmsWidgetName,
|
||||||
isServiceableInshop: true,
|
isServiceableInshop: true,
|
||||||
isServiceableMobile: true,
|
isServiceableMobile: true,
|
||||||
|
isServiceableDropoff: true,
|
||||||
},
|
},
|
||||||
mountOptions: {
|
mountOptions: {
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
@ -99,7 +100,7 @@ describe("appointment-type-question.vue", () => {
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Should display only the In-Shop and Drop-Off answers when only in-shop service is available", async () => {
|
it("Should display only the In-Shop answer when only in-shop service is available", async () => {
|
||||||
// Arrange/Act
|
// Arrange/Act
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
|
|
@ -107,6 +108,34 @@ describe("appointment-type-question.vue", () => {
|
||||||
cmsWidgetName: cmsWidgetName,
|
cmsWidgetName: cmsWidgetName,
|
||||||
isServiceableInshop: true,
|
isServiceableInshop: true,
|
||||||
isServiceableMobile: false,
|
isServiceableMobile: false,
|
||||||
|
isServiceableDropoff: false,
|
||||||
|
},
|
||||||
|
mountOptions: {
|
||||||
|
attachTo: document.body,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.vm.answersToDisplay).toEqual([
|
||||||
|
{
|
||||||
|
AnswerImageUrl: "",
|
||||||
|
Name: "Inshop",
|
||||||
|
SubText: "",
|
||||||
|
SubWidgetName: "",
|
||||||
|
Text: "In-shop",
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Should display only the In-Shop and Drop-Off answers when mobile service is not available", async () => {
|
||||||
|
// Arrange/Act
|
||||||
|
const { wrapper } = setupMocks({
|
||||||
|
mixins: [mockMixin],
|
||||||
|
props: {
|
||||||
|
cmsWidgetName: cmsWidgetName,
|
||||||
|
isServiceableInshop: true,
|
||||||
|
isServiceableMobile: false,
|
||||||
|
isServiceableDropoff: true,
|
||||||
},
|
},
|
||||||
mountOptions: {
|
mountOptions: {
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
@ -140,6 +169,7 @@ describe("appointment-type-question.vue", () => {
|
||||||
cmsWidgetName: cmsWidgetName,
|
cmsWidgetName: cmsWidgetName,
|
||||||
isServiceableInshop: false,
|
isServiceableInshop: false,
|
||||||
isServiceableMobile: true,
|
isServiceableMobile: true,
|
||||||
|
isServiceableDropoff: false,
|
||||||
},
|
},
|
||||||
mountOptions: {
|
mountOptions: {
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
@ -172,6 +202,7 @@ describe("appointment-type-question.vue", () => {
|
||||||
cmsWidgetName: cmsWidgetName,
|
cmsWidgetName: cmsWidgetName,
|
||||||
isServiceableInshop: true,
|
isServiceableInshop: true,
|
||||||
isServiceableMobile: true,
|
isServiceableMobile: true,
|
||||||
|
isServiceableDropoff: true,
|
||||||
},
|
},
|
||||||
mountOptions: {
|
mountOptions: {
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
@ -205,6 +236,7 @@ describe("appointment-type-question.vue", () => {
|
||||||
cmsWidgetName: cmsWidgetName,
|
cmsWidgetName: cmsWidgetName,
|
||||||
isServiceableInshop: false,
|
isServiceableInshop: false,
|
||||||
isServiceableMobile: false,
|
isServiceableMobile: false,
|
||||||
|
isServiceableDropoff: false,
|
||||||
},
|
},
|
||||||
mountOptions: {
|
mountOptions: {
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue