Skip to content

Commit

Permalink
fix(flow-item): set closed property to true when internal panel is cl…
Browse files Browse the repository at this point in the history
…osed (#9715)

**Related Issue:** #9714

## Summary

- sets flow-item to closed when internal panel is closed
- adds test
  • Loading branch information
driskull authored Jul 1, 2024
1 parent 7a70cf5 commit 69661bc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,18 @@ describe("calcite-flow-item", () => {

expect(toggleSpy).toHaveReceivedEventTimes(1);
});

it("honors calciteFlowItemClose event", async () => {
const page = await newE2EPage({
html: "<calcite-flow-item closable>test</calcite-flow-item>",
});

const toggleSpy = await page.spyOnEvent("calciteFlowItemClose");
const panel = await page.find("calcite-flow-item >>> calcite-panel");
panel.triggerEvent("calcitePanelClose");
await page.waitForChanges();

expect(toggleSpy).toHaveReceivedEventTimes(1);
expect(await panel.getProperty("closed")).toBe(true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ export class FlowItem

handlePanelClose = (event: CustomEvent<void>): void => {
event.stopPropagation();
this.closed = true;
this.calciteFlowItemClose.emit();
};

Expand Down

0 comments on commit 69661bc

Please sign in to comment.