diff --git a/src/common-components/textbox-question/textbox-question.spec.js b/src/common-components/textbox-question/textbox-question.spec.js index e2a5ab820..d8a29d9cd 100644 --- a/src/common-components/textbox-question/textbox-question.spec.js +++ b/src/common-components/textbox-question/textbox-question.spec.js @@ -200,21 +200,19 @@ describe("textboxQuestion.vue", () => { it("Should call this.handleChange when image is submitted with valid value.", async () => { // Arrange - const inputId = 'test'; - const responseValue = 'testResponse'; + const inputId = "test"; + const responseValue = "testResponse"; const storeMixin = { methods: { dispatchStoreAction: jest.fn().mockImplementation(() => { - return new Promise( - (resolve, reject) => resolve( - { - data: [ responseValue ] - } - ) + return new Promise((resolve, reject) => + resolve({ + data: [responseValue], + }) ); - }) - } + }), + }, }; const wrapper = shallowMount(textboxQuestion, { @@ -229,7 +227,7 @@ describe("textboxQuestion.vue", () => { inputId: inputId, }, mixins: [mockMixin, storeMixin], - attachTo: document.body + attachTo: document.body, }); wrapper.vm.handleChange = jest.fn().mockImplementation(() => {}); @@ -237,7 +235,7 @@ describe("textboxQuestion.vue", () => { // Act const imageUploadField = wrapper.find('[data-test="image-upload"]'); - await imageUploadField.trigger('change'); + await imageUploadField.trigger("change"); await wrapper.vm.$nextTick(); @@ -249,20 +247,18 @@ describe("textboxQuestion.vue", () => { it("Should emit image-lookup-error when image is submitted with invalid value", async () => { // Arrange - const inputId = 'test'; + const inputId = "test"; const storeMixin = { methods: { dispatchStoreAction: jest.fn().mockImplementation(() => { - return new Promise( - (resolve, reject) => resolve( - { - data: [] - } - ) + return new Promise((resolve, reject) => + resolve({ + data: [], + }) ); - }) - } + }), + }, }; const wrapper = shallowMount(textboxQuestion, { @@ -277,7 +273,7 @@ describe("textboxQuestion.vue", () => { inputId: inputId, }, mixins: [mockMixin, storeMixin], - attachTo: document.body + attachTo: document.body, }); wrapper.vm.handleChange = jest.fn().mockImplementation(() => {}); @@ -285,7 +281,7 @@ describe("textboxQuestion.vue", () => { // Act const imageUploadField = wrapper.find('[data-test="image-upload"]'); - await imageUploadField.trigger('change'); + await imageUploadField.trigger("change"); await wrapper.vm.$nextTick(); @@ -296,16 +292,14 @@ describe("textboxQuestion.vue", () => { it("Should emit image-lookup-error when image endpoint responds with an error", async () => { // Arrange - const inputId = 'test'; + const inputId = "test"; const storeMixin = { methods: { dispatchStoreAction: jest.fn().mockImplementation(() => { - return new Promise( - (resolve, reject) => reject() - ); - }) - } + return new Promise((resolve, reject) => reject()); + }), + }, }; const wrapper = shallowMount(textboxQuestion, { @@ -320,7 +314,7 @@ describe("textboxQuestion.vue", () => { inputId: inputId, }, mixins: [mockMixin, storeMixin], - attachTo: document.body + attachTo: document.body, }); wrapper.vm.handleChange = jest.fn().mockImplementation(() => {}); @@ -328,7 +322,7 @@ describe("textboxQuestion.vue", () => { // Act const imageUploadField = wrapper.find('[data-test="image-upload"]'); - await imageUploadField.trigger('change'); + await imageUploadField.trigger("change"); await wrapper.vm.$nextTick(); diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index 206a3ffc0..06174dafd 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -246,10 +246,10 @@ describe("vin-lookup.vue", () => { test("Error emitted by textbox-question element => VinScanFailed alert shown.", async () => { // Arrange const { wrapper } = setupMocks({}); - + // Act const vinLookup = wrapper.findComponent('[data-test="vin-lookup-component"]'); - vinLookup.trigger('imageLookupError'); + vinLookup.trigger("imageLookupError"); await wrapper.vm.$nextTick(); // Assert diff --git a/src/store/store.spec.js b/src/store/store.spec.js index 2a364243a..9c2dbb0a7 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -409,14 +409,14 @@ describe("Actions", () => { const dummyImage = {}; globalMethods.callHttpClient.mockImplementation(() => { - return Promise.resolve({ data: [ "1C6JJTAG3NL134044" ] }); + return Promise.resolve({ data: ["1C6JJTAG3NL134044"] }); }); // Act const response = await actions.lookupVinByImage(context, dummyImage); // Assert - expect(response.data).toEqual([ "1C6JJTAG3NL134044" ]); + expect(response.data).toEqual(["1C6JJTAG3NL134044"]); }); it("lookupVinByImage action, should reject if error in calling API", async () => { @@ -431,7 +431,9 @@ describe("Actions", () => { // Act // Assert - await expect(actions.lookupVinByImage(context, dummyImage)).rejects.toEqual("An error occurred"); + await expect(actions.lookupVinByImage(context, dummyImage)).rejects.toEqual( + "An error occurred" + ); }); it("getVehicleMakes action, should return makes list", async () => {