mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Unpaired users could only reach a waiting-room dead end and could not answer questions until a partner joined. Responses.couple_id is now nullable so a solo user answers immediately and banks "sealed answers" (couple_id IS NULL). Pairing claims both members' sealed answers and computes matches for every question both have now answered. Invite copy and the unpaired push nudge escalate with the sealed answer count. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
1.0 KiB
TypeScript
23 lines
1.0 KiB
TypeScript
import { buildInviteShareMessage } from "../../lib/inviteShareCopy";
|
|
|
|
describe("buildInviteShareMessage", () => {
|
|
it("leads with a plain invite when there are no sealed answers", () => {
|
|
const message = buildInviteShareMessage("ABCD1234", 0);
|
|
expect(message).toBe(
|
|
"Join me on Sauci! Tap this link to pair up instantly: https://sauci.app/join/ABCD1234 (or enter code ABCD1234 in the app)"
|
|
);
|
|
});
|
|
|
|
it("leads with earned value and singular wording for exactly one sealed answer", () => {
|
|
const message = buildInviteShareMessage("ABCD1234", 1);
|
|
expect(message).toBe(
|
|
"Join me on Sauci! I have already answered 1 question about us. Tap this link to unlock them: https://sauci.app/join/ABCD1234 (or enter code ABCD1234 in the app)"
|
|
);
|
|
});
|
|
|
|
it("pluralises for more than one sealed answer", () => {
|
|
const message = buildInviteShareMessage("ABCD1234", 5);
|
|
expect(message).toContain("I have already answered 5 questions about us.");
|
|
});
|
|
});
|