Formatting.
This commit is contained in:
parent
f24214fbca
commit
8b1a42547d
2 changed files with 115 additions and 112 deletions
|
|
@ -233,11 +233,14 @@ describe("textboxQuestion.vue", () => {
|
||||||
const inputId = "test";
|
const inputId = "test";
|
||||||
const responseValue = "testResponse";
|
const responseValue = "testResponse";
|
||||||
|
|
||||||
const imageHandler = jest.fn().mockImplementation(() => new Promise((resolve, reject) => {
|
const imageHandler = jest.fn().mockImplementation(
|
||||||
|
() =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
resolve({
|
resolve({
|
||||||
data: [responseValue],
|
data: [responseValue],
|
||||||
});
|
});
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const wrapper = shallowMount(textboxQuestion, {
|
const wrapper = shallowMount(textboxQuestion, {
|
||||||
global: {
|
global: {
|
||||||
|
|
@ -247,10 +250,10 @@ describe("textboxQuestion.vue", () => {
|
||||||
},
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
modelValue: "",
|
modelValue: "",
|
||||||
'onUpdate:modelValue': (v) => wrapper.setProps({modelValue: v}),
|
"onUpdate:modelValue": (v) => wrapper.setProps({ modelValue: v }),
|
||||||
includeImageQuestion: true,
|
includeImageQuestion: true,
|
||||||
inputId: inputId,
|
inputId: inputId,
|
||||||
imageQuestionSubmitHandler: imageHandler
|
imageQuestionSubmitHandler: imageHandler,
|
||||||
},
|
},
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
@ -278,11 +281,14 @@ describe("textboxQuestion.vue", () => {
|
||||||
const inputId = "test";
|
const inputId = "test";
|
||||||
const responseValue = "testResponse";
|
const responseValue = "testResponse";
|
||||||
|
|
||||||
const imageHandler = jest.fn().mockImplementation(() => new Promise((resolve, reject) => {
|
const imageHandler = jest.fn().mockImplementation(
|
||||||
|
() =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
resolve({
|
resolve({
|
||||||
data: [responseValue],
|
data: [responseValue],
|
||||||
});
|
});
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const wrapper = shallowMount(textboxQuestion, {
|
const wrapper = shallowMount(textboxQuestion, {
|
||||||
global: {
|
global: {
|
||||||
|
|
@ -292,10 +298,10 @@ describe("textboxQuestion.vue", () => {
|
||||||
},
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
modelValue: "",
|
modelValue: "",
|
||||||
'onUpdate:modelValue': (v) => wrapper.setProps({modelValue: v}),
|
"onUpdate:modelValue": (v) => wrapper.setProps({ modelValue: v }),
|
||||||
includeImageQuestion: true,
|
includeImageQuestion: true,
|
||||||
inputId: inputId,
|
inputId: inputId,
|
||||||
imageQuestionSubmitHandler: imageHandler
|
imageQuestionSubmitHandler: imageHandler,
|
||||||
},
|
},
|
||||||
mixins: [mockMixin],
|
mixins: [mockMixin],
|
||||||
attachTo: document.body,
|
attachTo: document.body,
|
||||||
|
|
@ -321,9 +327,12 @@ describe("textboxQuestion.vue", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const inputId = "test";
|
const inputId = "test";
|
||||||
|
|
||||||
const imageHandler = jest.fn().mockImplementation(() => new Promise((resolve, reject) => {
|
const imageHandler = jest.fn().mockImplementation(
|
||||||
|
() =>
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
reject({});
|
reject({});
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const wrapper = shallowMount(textboxQuestion, {
|
const wrapper = shallowMount(textboxQuestion, {
|
||||||
global: {
|
global: {
|
||||||
|
|
@ -333,7 +342,7 @@ describe("textboxQuestion.vue", () => {
|
||||||
},
|
},
|
||||||
propsData: {
|
propsData: {
|
||||||
modelValue: "",
|
modelValue: "",
|
||||||
'onUpdate:modelValue': (v) => wrapper.setProps({modelValue: v}),
|
"onUpdate:modelValue": (v) => wrapper.setProps({ modelValue: v }),
|
||||||
includeImageQuestion: true,
|
includeImageQuestion: true,
|
||||||
inputId: inputId,
|
inputId: inputId,
|
||||||
imageQuestionSubmitHandler: imageHandler,
|
imageQuestionSubmitHandler: imageHandler,
|
||||||
|
|
|
||||||
|
|
@ -262,9 +262,7 @@ describe("vin-lookup.vue", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const responseValue = "testResponse";
|
const responseValue = "testResponse";
|
||||||
const lookup = jest.fn().mockImplementation(() => {
|
const lookup = jest.fn().mockImplementation(() => {
|
||||||
return new Promise(
|
return new Promise((resolve, reject) => resolve([responseValue]));
|
||||||
(resolve, reject) => resolve([ responseValue ])
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const image = {};
|
const image = {};
|
||||||
|
|
@ -276,7 +274,7 @@ describe("vin-lookup.vue", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
mixins: [storeMixin]
|
mixins: [storeMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -284,15 +282,13 @@ describe("vin-lookup.vue", () => {
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
expect(lookup).toHaveBeenCalled();
|
expect(lookup).toHaveBeenCalled();
|
||||||
expect(response).toEqual(responseValue)
|
expect(response).toEqual(responseValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("GetVinFromImage rejects if no vins are returned.", async () => {
|
test("GetVinFromImage rejects if no vins are returned.", async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
const lookup = jest.fn().mockImplementation(() => {
|
const lookup = jest.fn().mockImplementation(() => {
|
||||||
return new Promise(
|
return new Promise((resolve, reject) => resolve([]));
|
||||||
(resolve, reject) => resolve([])
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const image = {};
|
const image = {};
|
||||||
|
|
@ -304,7 +300,7 @@ describe("vin-lookup.vue", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
mixins: [storeMixin]
|
mixins: [storeMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
@ -316,9 +312,7 @@ describe("vin-lookup.vue", () => {
|
||||||
|
|
||||||
test("GetVinFromImage rejects if an error occurs.", async () => {
|
test("GetVinFromImage rejects if an error occurs.", async () => {
|
||||||
const lookup = jest.fn().mockImplementation(() => {
|
const lookup = jest.fn().mockImplementation(() => {
|
||||||
return new Promise(
|
return new Promise((resolve, reject) => reject());
|
||||||
(resolve, reject) => reject()
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const image = {};
|
const image = {};
|
||||||
|
|
@ -330,7 +324,7 @@ describe("vin-lookup.vue", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const { wrapper } = setupMocks({
|
const { wrapper } = setupMocks({
|
||||||
mixins: [storeMixin]
|
mixins: [storeMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue