Invite people after review, then finish the Rule, with login before inviting and Invite your members on Profile.
This commit is contained in:
1 parent
88bfccd1e7
commit
70ceb73104
31 files changed
+1388
-401
No files matched your search
@@ -53,6 +53,7 @@ function viewProps(
|
||||
onCloseDeleteRule: vi.fn(),
|
||||
onConfirmDeleteRule: vi.fn(),
|
||||
onDuplicateRule: vi.fn(),
|
||||
onInviteMembers: vi.fn(),
|
||||
onContinueDraft: vi.fn(),
|
||||
onDeleteDraft: vi.fn(),
|
||||
onCloseDeleteDraft: vi.fn(),
|
||||
@@ -142,4 +143,45 @@ describe("ProfilePageView", () => {
|
||||
await user.click(confirm);
|
||||
expect(onConfirmDeleteAccount).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
test("finished owner cards offer Invite your members beside Duplicate and Delete", async () => {
|
||||
const user = userEvent.setup();
|
||||
const onInviteMembers = vi.fn();
|
||||
render(
|
||||
<ProfilePageView
|
||||
{...viewProps({
|
||||
onInviteMembers,
|
||||
rules: [
|
||||
{
|
||||
id: "rule-1",
|
||||
title: "Garden coop",
|
||||
summary: "How we share the plots.",
|
||||
createdAt: "2026-11-01T00:00:00.000Z",
|
||||
updatedAt: "2026-11-01T00:00:00.000Z",
|
||||
role: "owner",
|
||||
},
|
||||
],
|
||||
})}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(
|
||||
screen.getByText(copy.welcomeBodyFirstRule),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText(copy.finishedBadge)).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { name: copy.yourRulesHeading }),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: copy.inviteMembers }),
|
||||
);
|
||||
expect(onInviteMembers).toHaveBeenCalledWith("rule-1");
|
||||
expect(
|
||||
screen.getByRole("button", { name: copy.duplicate }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("button", { name: copy.deleteRule }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user