Let guests keep a published rule via Save & Exit and a post-finalize sign-in prompt.

Email is optional so they can continue without saving; skip from Save & Exit leaves the flow instead of returning to completed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-09-02 16:18:41 -06:00
co-authored by Cursor
parent 84ef943df4
commit db34a1f0df
17 changed files with 521 additions and 60 deletions
+20
View File
@@ -110,6 +110,26 @@ describe("Login", () => {
expect(onClose).toHaveBeenCalledTimes(1);
});
it("closes on backdrop pointerdown, not a leftover click", async () => {
const onClose = vi.fn();
renderWithProviders(
<Login isOpen onClose={onClose} ariaLabelledBy="login-modal-heading">
<p id="login-modal-heading">Body</p>
</Login>,
);
await waitFor(() => {
expect(screen.getByRole("dialog")).toBeInTheDocument();
});
const backdrop = screen.getByRole("dialog").parentElement;
expect(backdrop).not.toBeNull();
fireEvent.click(backdrop!);
expect(onClose).not.toHaveBeenCalled();
fireEvent.pointerDown(screen.getByRole("dialog"));
expect(onClose).not.toHaveBeenCalled();
fireEvent.pointerDown(backdrop!);
expect(onClose).toHaveBeenCalledTimes(1);
});
it("locks body scroll while open", async () => {
renderWithProviders(
<Login isOpen onClose={vi.fn()} ariaLabelledBy="login-modal-heading">