diff --git a/src/common-components/base-input-button/base-input-button.spec.js b/src/common-components/base-input-button/base-input-button.spec.js index 87e8af6d2..8a3ff6356 100644 --- a/src/common-components/base-input-button/base-input-button.spec.js +++ b/src/common-components/base-input-button/base-input-button.spec.js @@ -228,7 +228,7 @@ describe("baseInputButton.vue", () => { expect(wrapper.emitted()).not.toHaveProperty("update:modelValue"); }); - test("focus and click enter on a checkbox => update:modelValue is emitted with correct value", async () => { + test("focus and click enter on a checkbox => nothing should happen", async () => { // Arrange const { wrapper } = setupMocks({ mockData: { @@ -243,9 +243,10 @@ describe("baseInputButton.vue", () => { // Act await input.trigger("keypress", { key: "enter" }); + console.log(wrapper.emitted()["update:modelValue"]); // Assert - expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual(["Hi"]); + expect(wrapper.emitted()["update:modelValue"]).toBe(undefined); }); }); @@ -319,7 +320,7 @@ describe("baseInputButton.vue", () => { expect(wrapper.vm.handlePushClickEventToGACheck).not.toHaveBeenCalled(); }); - test("eventType === eventTypes.ENTER => call handleClick and handlePushClickEventToGACheck", () => { + test("eventType === eventTypes.ENTER => do nothing", () => { // Arrange const { wrapper } = setupMocks({ mockData: { @@ -336,11 +337,9 @@ describe("baseInputButton.vue", () => { wrapper.vm.handleEventAction("enter", { myEvent: "test" }); // Assert - expect(wrapper.vm.handleClick).toHaveBeenCalledWith({ - myEvent: "test", - }); - expect(wrapper.vm.handlePushClickEventToGACheck).toHaveBeenCalledWith("click"); + expect(wrapper.vm.handleClick).not.toHaveBeenCalled(); expect(wrapper.vm.handleSelectionChange).not.toHaveBeenCalled(); + expect(wrapper.vm.handlePushClickEventToGACheck).not.toHaveBeenCalled(); }); test("eventType === eventTypes.CHANGE => call handleClick and handlePushClickEventToGACheck", () => { diff --git a/src/common-components/base-input-button/base-input-button.vue b/src/common-components/base-input-button/base-input-button.vue index b71f4a63c..006323a18 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -53,7 +53,6 @@ export default { handleEventAction(eventType, e) { if (this.isMultiSelect) { switch (eventType) { - case this.eventTypes.ENTER: case this.eventTypes.CHANGE: this.handleClick(e); this.handlePushClickEventToGACheck(this.eventTypes.CLICK);