Rename 'gift' to 'guest' throughout: guest pill, Guests list wording, provision-guest route and send form (pure rename, no behaviour change)
This commit is contained in:
1 parent
7b8a3f5654
commit
a8674af611
2 files changed
+61
-61
No files matched your search
@@ -1,9 +1,9 @@
|
||||
// Harness for the admin panel's GUESTS list (gift accounts), run through the
|
||||
// Harness for the admin panel's GUESTS list (guest accounts), run through the
|
||||
// skill's checker alongside the chart harness:
|
||||
// ~/.hermes/skills/research/inference-cooperative/scripts/check-page-js.sh \
|
||||
// app/main.py admin-panel-guests-harness.js
|
||||
// Exercises load() against both payload shapes — the portal's split payload
|
||||
// (guests[]) and an older payload that still tags rows account_type='gift'
|
||||
// (guests[]) and an older payload that still tags rows account_type='guest'
|
||||
// inside members[] — and asserts the invariants that matter:
|
||||
// * guests NEVER count as members, in either shape;
|
||||
// * guests never render in the members table;
|
||||
@@ -36,9 +36,9 @@ await runLoad({
|
||||
members: [memberRow("alice@example.com", 2), memberRow("bob@example.com", 1)],
|
||||
guests: [{
|
||||
email: "friend@example.com", username: "friend", active: true,
|
||||
account_type: "gift", gift_inviter: "alice@example.com",
|
||||
account_type: "guest", guest_inviter: "alice@example.com",
|
||||
credit_balance: 5, credits_remaining: 3.5,
|
||||
gift_expires_at: "2027-01-07T02:00:00", gift_status: "active",
|
||||
guest_expires_at: "2027-01-07T02:00:00", guest_status: "active",
|
||||
spend: 1.5, all_time_spend: 1.5,
|
||||
}],
|
||||
totals: { members: 2, total_spend: 4.5, total_all_time_spend: 45,
|
||||
@@ -71,21 +71,21 @@ switchView("members");
|
||||
assert(document.getElementById("guests-section").style.display === "",
|
||||
"guests section returns on the Members view");
|
||||
|
||||
// ---- Shape 2: older payload — gifts tagged inside members[] ----
|
||||
// ---- Shape 2: older payload — guests tagged inside members[] ----
|
||||
await runLoad({
|
||||
members: [
|
||||
memberRow("alice@example.com", 2),
|
||||
memberRow("bob@example.com", 1),
|
||||
{ email: "friend@example.com", username: "friend", active: true,
|
||||
account_type: "gift", gift_inviter: "alice@example.com",
|
||||
credit_balance: 5, credits_remaining: 3.5, gift_expires_at: "2027-01-07T02:00:00",
|
||||
gift_status: "active", spend: 0.5, all_time_spend: 5 },
|
||||
account_type: "guest", guest_inviter: "alice@example.com",
|
||||
credit_balance: 5, credits_remaining: 3.5, guest_expires_at: "2027-01-07T02:00:00",
|
||||
guest_status: "active", spend: 0.5, all_time_spend: 5 },
|
||||
],
|
||||
totals: { members: 3, total_spend: 3.5, total_all_time_spend: 35,
|
||||
operator_spend: 0, operator_all_time_spend: 0 },
|
||||
});
|
||||
assert(txt("tot-members") === "2",
|
||||
"old payload: gift row subtracted from the member count (got " + txt("tot-members") + ")");
|
||||
"old payload: guest row subtracted from the member count (got " + txt("tot-members") + ")");
|
||||
assert(txt("tot-guests") === "1", "old payload: guest derived and counted");
|
||||
assert(txt("tot-spend-cycle") === "$3.00",
|
||||
"old payload: guest spend excluded from the spend total (3.5 - 0.5)");
|
||||
@@ -98,12 +98,12 @@ assert(document.getElementById("guest-rows").innerHTML.indexOf("friend@example.c
|
||||
await runLoad({
|
||||
members: [memberRow("alice@example.com", 2)],
|
||||
guests: [
|
||||
{ email: "lapsed@example.com", username: null, active: false, account_type: "gift",
|
||||
gift_inviter: "alice@example.com", credit_balance: 2, credits_remaining: 2,
|
||||
gift_expires_at: "2026-12-01T00:00:00", gift_status: "expired", spend: 3, all_time_spend: 3 },
|
||||
{ email: "joined@example.com", username: "joined", active: true, account_type: "gift",
|
||||
gift_inviter: "alice@example.com", credit_balance: 1, credits_remaining: 1,
|
||||
gift_expires_at: null, gift_status: "converted", spend: 4, all_time_spend: 4 },
|
||||
{ email: "lapsed@example.com", username: null, active: false, account_type: "guest",
|
||||
guest_inviter: "alice@example.com", credit_balance: 2, credits_remaining: 2,
|
||||
guest_expires_at: "2026-12-01T00:00:00", guest_status: "expired", spend: 3, all_time_spend: 3 },
|
||||
{ email: "joined@example.com", username: "joined", active: true, account_type: "guest",
|
||||
guest_inviter: "alice@example.com", credit_balance: 1, credits_remaining: 1,
|
||||
guest_expires_at: null, guest_status: "converted", spend: 4, all_time_spend: 4 },
|
||||
],
|
||||
totals: { members: 1, total_spend: 2, total_all_time_spend: 20,
|
||||
operator_spend: 0, operator_all_time_spend: 0 },
|
||||
|
||||
Reference in new issue
Block a user