diff --git a/packages/calcite-components/src/components/combobox/combobox.e2e.ts b/packages/calcite-components/src/components/combobox/combobox.e2e.ts index e4ce32d82d2..de4047c6bc8 100644 --- a/packages/calcite-components/src/components/combobox/combobox.e2e.ts +++ b/packages/calcite-components/src/components/combobox/combobox.e2e.ts @@ -1948,6 +1948,27 @@ describe("calcite-combobox", () => { expect(eventSpy).toHaveReceivedEventTimes(1); expect((await element.getProperty("selectedItems")).length).toBe(2); }); + + it("should not emit calciteComboboxChange event when value attribute is updated", async () => { + const page = await newE2EPage(); + await page.setContent( + html` + + + + `, + ); + await page.waitForChanges(); + + const eventSpy = await page.spyOnEvent("calciteComboboxChange"); + const combobox = await page.find("calcite-combobox"); + expect(await combobox.getProperty("value")).toBe("one"); + + combobox.setProperty("value", "two"); + await page.waitForChanges(); + expect(eventSpy).toHaveReceivedEventTimes(0); + expect(await combobox.getProperty("value")).toBe("two"); + }); }); describe("calciteComboboxItemChange event correctly updates active item index", () => { @@ -2743,4 +2764,25 @@ describe("calcite-combobox", () => { expect(await combobox.getProperty("value")).toBe("three"); }); + + it("should not emit calciteComboboxItemChange event when selected attribute is toggled", async () => { + const page = await newE2EPage(); + await page.setContent( + html` + + + + `, + ); + await page.waitForChanges(); + + const eventSpy = await page.spyOnEvent("calciteComboboxItemChange"); + const two = await page.find("#two"); + two.setProperty("selected", "true"); + await page.waitForChanges(); + expect(eventSpy).toHaveReceivedEventTimes(0); + + const combobox = await page.find("calcite-combobox"); + expect((await combobox.getProperty("selectedItems")).length).toBe(1); + }); });