create-ailk 0.36.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/component-catalog.json +40 -1
- package/component-catalog.md +7 -5
- package/dist/add-route.d.ts +5 -0
- package/dist/add-route.js +10 -2
- package/dist/surfaces.js +60 -19
- package/dist/sync-routes.d.ts +15 -1
- package/dist/sync-routes.js +58 -6
- package/dist/template-record.d.ts +11 -0
- package/dist/template-record.js +18 -0
- package/dist/update.d.ts +33 -1
- package/dist/update.js +439 -56
- package/package.json +3 -3
- package/templates/.env.example +17 -0
- package/templates/apps/api/.env.example +38 -0
- package/templates/apps/api/CLAUDE.md +3 -0
- package/templates/apps/api/src/lib/__mocks__/prisma.ts +7 -0
- package/templates/apps/mcp/CLAUDE.md +1 -1
- package/templates/apps/web/CLAUDE.md +28 -1
- package/templates/apps/web/app/[locale]/(auth)/reset-password/__tests__/return.test.tsx +179 -0
- package/templates/apps/web/app/[locale]/(auth)/reset-password/page.tsx +22 -2
- package/templates/apps/web/app/[locale]/(auth)/reset-password/reset-password-card.tsx +9 -2
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/billing.test.tsx +240 -76
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/general.test.tsx +242 -28
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/hub-mode.test.tsx +369 -196
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/item.test.tsx +26 -1
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/layout.test.tsx +17 -6
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-menu.test.tsx +51 -12
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/new-popups.test.tsx +17 -2
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/notifications.test.tsx +153 -2
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/page.test.tsx +206 -23
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/popups.test.tsx +150 -188
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/privacy.test.tsx +235 -177
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/rich-translator.ts +63 -0
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/security.test.tsx +0 -3
- package/templates/apps/web/app/[locale]/(authed)/account/__tests__/thread.test.tsx +340 -0
- package/templates/apps/web/app/[locale]/(authed)/account/account-data.ts +7 -5
- package/templates/apps/web/app/[locale]/(authed)/account/account-frame.tsx +19 -3
- package/templates/apps/web/app/[locale]/(authed)/account/actions.ts +8 -4
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/[slug]/page.tsx +161 -0
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/__tests__/page.test.tsx +426 -0
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/appointments-data.ts +76 -0
- package/templates/apps/web/app/[locale]/(authed)/account/appointments/page.tsx +139 -0
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/page.tsx +92 -24
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/[pieceId]/versions/[version]/file/route.ts +32 -1
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/file-route.test.ts +76 -3
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/__tests__/page.test.tsx +290 -41
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/artifact-data.ts +109 -11
- package/templates/apps/web/app/[locale]/(authed)/account/artifacts/page.tsx +43 -44
- package/templates/apps/web/app/[locale]/(authed)/account/billing/__tests__/offerings.test.ts +99 -0
- package/templates/apps/web/app/[locale]/(authed)/account/billing/offerings.ts +123 -0
- package/templates/apps/web/app/[locale]/(authed)/account/billing/page.tsx +309 -113
- package/templates/apps/web/app/[locale]/(authed)/account/billing-source.ts +192 -65
- package/templates/apps/web/app/[locale]/(authed)/account/components/request-quote.tsx +52 -7
- package/templates/apps/web/app/[locale]/(authed)/account/general/account-name.ts +36 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/contact-actions.ts +70 -2
- package/templates/apps/web/app/[locale]/(authed)/account/general/contact-details.tsx +42 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/page.tsx +55 -58
- package/templates/apps/web/app/[locale]/(authed)/account/general/phone-verification.tsx +2 -1
- package/templates/apps/web/app/[locale]/(authed)/account/general/photo-actions.ts +73 -0
- package/templates/apps/web/app/[locale]/(authed)/account/general/profile-form.tsx +12 -9
- package/templates/apps/web/app/[locale]/(authed)/account/general/profile-source.ts +18 -4
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/[kind]/[id]/page.tsx +20 -2
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/member-thread-composer.tsx +43 -0
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/page.tsx +125 -0
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-data.ts +88 -0
- package/templates/apps/web/app/[locale]/(authed)/account/inbox/thread/thread-write.ts +31 -0
- package/templates/apps/web/app/[locale]/(authed)/account/layout.tsx +3 -2
- package/templates/apps/web/app/[locale]/(authed)/account/new-menu.tsx +33 -8
- package/templates/apps/web/app/[locale]/(authed)/account/new-popups.tsx +31 -52
- package/templates/apps/web/app/[locale]/(authed)/account/notifications/page.tsx +44 -4
- package/templates/apps/web/app/[locale]/(authed)/account/page.tsx +69 -49
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/__tests__/export-route.test.ts +173 -0
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/actions.ts +42 -4
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/export/route.ts +102 -0
- package/templates/apps/web/app/[locale]/(authed)/account/privacy/page.tsx +147 -137
- package/templates/apps/web/app/[locale]/(authed)/account/security/__tests__/hub-variant.test.tsx +258 -0
- package/templates/apps/web/app/[locale]/(authed)/account/security/page.tsx +18 -21
- package/templates/apps/web/app/[locale]/(authed)/account/security/security-panel.tsx +34 -6
- package/templates/apps/web/app/[locale]/(authed)/account/security/security-source.ts +37 -7
- package/templates/apps/web/app/[locale]/(authed)/account/settings/page.tsx +0 -2
- package/templates/apps/web/app/[locale]/(authed)/account/settings-frame.tsx +8 -5
- package/templates/apps/web/app/[locale]/flows/[slug]/results/[payload]/ResultsClient.tsx +3 -2
- package/templates/apps/web/app/api/auth/hub/password/__tests__/return.test.ts +86 -0
- package/templates/apps/web/app/api/auth/hub/password/__tests__/route.test.ts +368 -0
- package/templates/apps/web/app/api/auth/hub/password/return.ts +86 -0
- package/templates/apps/web/app/api/auth/hub/password/route.ts +171 -0
- package/templates/apps/web/app/api/hub-session/__tests__/routes.test.ts +263 -0
- package/templates/apps/web/app/api/hub-session/password/return/route.ts +69 -0
- package/templates/apps/web/app/api/hub-session/password/route.ts +106 -0
- package/templates/apps/web/lib/__tests__/account-config.test.ts +129 -1
- package/templates/apps/web/lib/__tests__/offerings-pricing.test.ts +33 -0
- package/templates/apps/web/lib/account-config.ts +132 -8
- package/templates/apps/web/lib/auth-routes.ts +11 -6
- package/templates/apps/web/lib/offerings-pricing.ts +4 -1
- package/templates/apps/web/messages/en.json +156 -80
- package/versions.json +48 -48
- package/templates/apps/web/app/[locale]/(authed)/account/components/schedule-service.tsx +0 -276
- package/templates/apps/web/app/[locale]/(authed)/account/components/send-message.tsx +0 -128
- package/templates/apps/web/app/[locale]/(authed)/account/settings/__tests__/theme-modes.test.ts +0 -42
- package/templates/apps/web/app/[locale]/(authed)/account/settings/theme-modes.ts +0 -40
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* U4 · D6a, D9, D12; AC-7 as amended 2026-10-01; #8231 D3, D5–D7).
|
|
4
4
|
*
|
|
5
5
|
* Covers:
|
|
6
|
-
* 1. The tabs All ·
|
|
7
|
-
* included), All selected (#8231 D3).
|
|
8
|
-
* 2. All holds every row newest first
|
|
9
|
-
*
|
|
10
|
-
* `
|
|
6
|
+
* 1. The tabs All · Messages · Orders · Scheduled (#11149), each with its
|
|
7
|
+
* count (zeros included), All selected (#8231 D3); `?tab=` opens one.
|
|
8
|
+
* 2. All holds every row newest first — the union of the other tabs and
|
|
9
|
+
* the updates-only kinds, each once — each linking to its item page;
|
|
10
|
+
* Orders (the `purchases` tab) holds the kinds whose section is
|
|
11
|
+
* `purchases`; Scheduled the `upcoming` kinds, upcoming soonest first,
|
|
12
|
+
* then past newest first. No lead renders (#11149).
|
|
11
13
|
* 3. `email-unverified` and `payment-due` are For-you items (the phone
|
|
12
14
|
* For you tab), never Inbox rows.
|
|
13
15
|
* 4. A member with no name gets an "Add your name" For-you item (needs-you,
|
|
@@ -27,7 +29,7 @@
|
|
|
27
29
|
* retired, whatever `member.consents` answers (the layout's interstitial
|
|
28
30
|
* is the one place an agreement is asked).
|
|
29
31
|
*/
|
|
30
|
-
import { act, fireEvent, render, screen, within } from "@testing-library/react";
|
|
32
|
+
import { act, cleanup as cleanupRender, fireEvent, render, screen, within } from "@testing-library/react";
|
|
31
33
|
|
|
32
34
|
// The global setup mock resolves only top-level namespace keys against
|
|
33
35
|
// en.json; the area reads nested keys (`inbox.tabs.all`, …) — a call
|
|
@@ -83,9 +85,11 @@ const mockSignupMe = jest.fn();
|
|
|
83
85
|
const mockSubscriptionMe = jest.fn();
|
|
84
86
|
const mockMemberPieces = jest.fn();
|
|
85
87
|
const mockMemberMessages = jest.fn();
|
|
88
|
+
const mockMemberRequests = jest.fn();
|
|
86
89
|
const mockMemberPurchases = jest.fn();
|
|
87
90
|
const mockMemberAppointments = jest.fn();
|
|
88
91
|
const mockMemberConsents = jest.fn();
|
|
92
|
+
const mockMemberWelcome = jest.fn();
|
|
89
93
|
const mockAccountAgreements = jest.fn();
|
|
90
94
|
jest.mock("@working-theory/api-client", () => ({
|
|
91
95
|
__esModule: true,
|
|
@@ -98,6 +102,8 @@ jest.mock("@working-theory/api-client", () => ({
|
|
|
98
102
|
member: {
|
|
99
103
|
pieces: (...args: unknown[]) => mockMemberPieces(...args),
|
|
100
104
|
messages: (...args: unknown[]) => mockMemberMessages(...args),
|
|
105
|
+
// #11157 — the member's own sent requests and messages, the Messages tab.
|
|
106
|
+
requests: (...args: unknown[]) => mockMemberRequests(...args),
|
|
101
107
|
purchases: (...args: unknown[]) => mockMemberPurchases(...args),
|
|
102
108
|
appointments: (...args: unknown[]) => mockMemberAppointments(...args),
|
|
103
109
|
// #10826 D7 — the user-magnet results read; 404 here (no workspace module).
|
|
@@ -107,6 +113,8 @@ jest.mock("@working-theory/api-client", () => ({
|
|
|
107
113
|
status: 404,
|
|
108
114
|
body: { ok: false, error: { code: "not_found", message: "Not found" } },
|
|
109
115
|
}),
|
|
116
|
+
// #11150 — the onboarding-steps read; 404 unless a case welcomes the member.
|
|
117
|
+
welcome: (...args: unknown[]) => mockMemberWelcome(...args),
|
|
110
118
|
// #8765 D8 — the retired card's read; the page must not depend on it.
|
|
111
119
|
consents: (...args: unknown[]) => mockMemberConsents(...args),
|
|
112
120
|
// #8233 C4 — the New menu's availability reads; 404 here, so the Inbox
|
|
@@ -225,6 +233,15 @@ const MESSAGE = {
|
|
|
225
233
|
readAt: null,
|
|
226
234
|
};
|
|
227
235
|
|
|
236
|
+
/** #11157 — a quote request the member sent from the New menu moments ago. */
|
|
237
|
+
const SENT_REQUEST = {
|
|
238
|
+
id: "intx_01920000-0000-7000-8000-000000000157",
|
|
239
|
+
kind: "quote" as const,
|
|
240
|
+
subject: "Request quote",
|
|
241
|
+
body: "",
|
|
242
|
+
createdAt: "2026-09-11T14:36:56.000Z",
|
|
243
|
+
};
|
|
244
|
+
|
|
228
245
|
const MESSAGE_WITH_FILE = {
|
|
229
246
|
id: "intx_01920000-0000-7000-8000-000000000004",
|
|
230
247
|
subject: "Your brand guide",
|
|
@@ -281,8 +298,15 @@ function needsClientSource(): (typeof accountForYouSources)[number] {
|
|
|
281
298
|
}
|
|
282
299
|
|
|
283
300
|
/** Renders the page on a phone tab — the frame's PhoneTabProvider. */
|
|
284
|
-
async function renderPage(
|
|
285
|
-
|
|
301
|
+
async function renderPage(
|
|
302
|
+
locale = "en",
|
|
303
|
+
tab = "inbox",
|
|
304
|
+
query?: Record<string, string | string[]>,
|
|
305
|
+
): Promise<void> {
|
|
306
|
+
const element = await Page({
|
|
307
|
+
params: Promise.resolve({ locale }),
|
|
308
|
+
...(query === undefined ? {} : { searchParams: Promise.resolve(query) }),
|
|
309
|
+
});
|
|
286
310
|
render(<PhoneTabProvider tab={tab}>{element}</PhoneTabProvider>);
|
|
287
311
|
}
|
|
288
312
|
|
|
@@ -306,6 +330,11 @@ beforeEach(() => {
|
|
|
306
330
|
accountExperimentKeys.length = 0;
|
|
307
331
|
mockGetSession.mockReset().mockResolvedValue(SESSION);
|
|
308
332
|
mockSignupMe.mockReset().mockResolvedValue({ ok: true, body: SIGNUP });
|
|
333
|
+
mockMemberWelcome.mockReset().mockResolvedValue({
|
|
334
|
+
ok: false,
|
|
335
|
+
status: 404,
|
|
336
|
+
body: { ok: false, error: { code: "not_found", message: "Not found" } },
|
|
337
|
+
});
|
|
309
338
|
mockSubscriptionMe.mockReset().mockResolvedValue(NO_SUBSCRIPTION);
|
|
310
339
|
mockMemberPurchases
|
|
311
340
|
.mockReset()
|
|
@@ -314,6 +343,7 @@ beforeEach(() => {
|
|
|
314
343
|
// The page's pieces and messages answer 404 unless a case fills them.
|
|
315
344
|
mockMemberPieces.mockReset().mockResolvedValue(notFound);
|
|
316
345
|
mockMemberMessages.mockReset().mockResolvedValue(notFound);
|
|
346
|
+
mockMemberRequests.mockReset().mockResolvedValue(notFound);
|
|
317
347
|
mockAccountAgreements
|
|
318
348
|
.mockReset()
|
|
319
349
|
.mockResolvedValue({ ok: true, body: { agreements: [], complete: true } });
|
|
@@ -332,6 +362,11 @@ function memberRows(): void {
|
|
|
332
362
|
});
|
|
333
363
|
}
|
|
334
364
|
|
|
365
|
+
afterEach(() => {
|
|
366
|
+
// The viewer-zone case spies on `Intl.DateTimeFormat.prototype.resolvedOptions`.
|
|
367
|
+
jest.restoreAllMocks();
|
|
368
|
+
});
|
|
369
|
+
|
|
335
370
|
afterAll(() => {
|
|
336
371
|
accountExperimentKeys.length = 0;
|
|
337
372
|
});
|
|
@@ -455,7 +490,7 @@ describe("no Inbox loader runs behind the interstitial (#8765 D7)", () => {
|
|
|
455
490
|
});
|
|
456
491
|
});
|
|
457
492
|
|
|
458
|
-
describe("the Inbox — tabs All ·
|
|
493
|
+
describe("the Inbox — tabs All · Messages · Orders · Scheduled (#8231 D3, AC-3; #11157; #11149)", () => {
|
|
459
494
|
/** The rows of one tab, by title, after selecting it. */
|
|
460
495
|
function tabRows(id: string): string[] {
|
|
461
496
|
fireEvent.mouseDown(screen.getByTestId(`inbox-tab-${id}`));
|
|
@@ -464,7 +499,7 @@ describe("the Inbox — tabs All · Purchases · Scheduled (#8231 D3, AC-3)", ()
|
|
|
464
499
|
.map((row) => within(row).getByRole("link").textContent ?? "");
|
|
465
500
|
}
|
|
466
501
|
|
|
467
|
-
it("renders All ·
|
|
502
|
+
it("renders All · Messages · Orders · Scheduled with counts, All selected — no Recents or Suggested", async () => {
|
|
468
503
|
accountExperimentKeys.push("ailk-founder-diagnostic");
|
|
469
504
|
mockMemberPieces.mockResolvedValue({ ok: true, body: { items: [PIECE] } });
|
|
470
505
|
mockMemberMessages.mockResolvedValue({
|
|
@@ -487,12 +522,14 @@ describe("the Inbox — tabs All · Purchases · Scheduled (#8231 D3, AC-3)", ()
|
|
|
487
522
|
const tabs = screen.getAllByRole("tab");
|
|
488
523
|
expect(tabs.map((tab) => tab.getAttribute("data-testid"))).toEqual([
|
|
489
524
|
"inbox-tab-all",
|
|
525
|
+
"inbox-tab-messages",
|
|
490
526
|
"inbox-tab-purchases",
|
|
491
527
|
"inbox-tab-scheduled",
|
|
492
528
|
]);
|
|
493
529
|
expect(tabs.map((tab) => tab.textContent)).toEqual([
|
|
494
530
|
"All5",
|
|
495
|
-
"
|
|
531
|
+
"Messages1",
|
|
532
|
+
"Orders1",
|
|
496
533
|
"Scheduled1",
|
|
497
534
|
]);
|
|
498
535
|
expect(screen.getByTestId("inbox-tab-all")).toHaveAttribute(
|
|
@@ -510,17 +547,98 @@ describe("the Inbox — tabs All · Purchases · Scheduled (#8231 D3, AC-3)", ()
|
|
|
510
547
|
expect.stringContaining("pro"),
|
|
511
548
|
expect.stringContaining("ailk-founder-diagnostic"),
|
|
512
549
|
]);
|
|
513
|
-
//
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
550
|
+
// #11149 — All is the union: every other tab's rows, each exactly
|
|
551
|
+
// once, plus the updates-only result row, newest first (above).
|
|
552
|
+
const allTitles = all.map((row) => within(row).getByRole("link").textContent ?? "");
|
|
553
|
+
// Messages: the provider's message only (#11157). Orders (the
|
|
554
|
+
// `purchases` tab): the purchase row only. Scheduled: the appointment only.
|
|
555
|
+
const messages = tabRows("messages");
|
|
556
|
+
const orders = tabRows("purchases");
|
|
557
|
+
const scheduled = tabRows("scheduled");
|
|
558
|
+
expect(messages).toEqual([expect.stringContaining("Kickoff notes")]);
|
|
559
|
+
expect(orders).toEqual([expect.stringContaining("pro")]);
|
|
560
|
+
expect(scheduled).toEqual([expect.stringContaining("Kickoff call")]);
|
|
561
|
+
const others = [...messages, ...orders, ...scheduled];
|
|
562
|
+
for (const title of others) {
|
|
563
|
+
expect(allTitles.filter((t) => t === title)).toHaveLength(1);
|
|
564
|
+
}
|
|
565
|
+
// + the two updates-only rows (the piece and the result), under All alone.
|
|
566
|
+
expect(allTitles).toHaveLength(others.length + 2);
|
|
518
567
|
// The result row is under All and in no other tab.
|
|
519
568
|
expect(
|
|
520
569
|
screen.queryByText("ailk-founder-diagnostic"),
|
|
521
570
|
).not.toBeInTheDocument();
|
|
522
571
|
});
|
|
523
572
|
|
|
573
|
+
it("#11157 AC-2 — a request the member sent lists under Messages and All, beside the provider's message, as its own item entry", async () => {
|
|
574
|
+
mockMemberMessages.mockResolvedValue({ ok: true, body: { items: [MESSAGE] } });
|
|
575
|
+
mockMemberRequests.mockResolvedValue({ ok: true, body: { items: [SENT_REQUEST] } });
|
|
576
|
+
await renderPage();
|
|
577
|
+
expect(screen.getAllByRole("tab").map((tab) => tab.textContent)).toEqual([
|
|
578
|
+
"All3",
|
|
579
|
+
"Messages2",
|
|
580
|
+
"Orders1",
|
|
581
|
+
"Scheduled0",
|
|
582
|
+
]);
|
|
583
|
+
// All: the sent request first (newest), then the provider's message.
|
|
584
|
+
const all = within(screen.getByTestId("inbox-all")).getAllByTestId("inbox-all-row");
|
|
585
|
+
expect(all.map((row) => row.textContent)).toEqual([
|
|
586
|
+
expect.stringContaining("Request quote"),
|
|
587
|
+
expect.stringContaining("Kickoff notes"),
|
|
588
|
+
expect.stringContaining("pro"),
|
|
589
|
+
]);
|
|
590
|
+
expect(all[0]).toHaveTextContent("Sent ·");
|
|
591
|
+
expect(within(all[0]!).getByRole("link")).toHaveAttribute(
|
|
592
|
+
"href",
|
|
593
|
+
`/account/inbox/request/${SENT_REQUEST.id}`,
|
|
594
|
+
);
|
|
595
|
+
// Messages: the two conversation rows only; Orders and Scheduled unchanged.
|
|
596
|
+
expect(tabRows("messages")).toEqual([
|
|
597
|
+
expect.stringContaining("Request quote"),
|
|
598
|
+
expect.stringContaining("Kickoff notes"),
|
|
599
|
+
]);
|
|
600
|
+
expect(tabRows("purchases")).toEqual([expect.stringContaining("pro")]);
|
|
601
|
+
expect(tabRows("scheduled")).toEqual([]);
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
it("renders each row's day as a <time> in the server fallback zone until hydration (#11175)", async () => {
|
|
605
|
+
mockMemberAppointments.mockResolvedValue({
|
|
606
|
+
ok: true,
|
|
607
|
+
body: {
|
|
608
|
+
upcoming: [appointment("appt_1", "Kickoff call", "2026-09-11T03:30:00.000Z")],
|
|
609
|
+
past: [],
|
|
610
|
+
},
|
|
611
|
+
});
|
|
612
|
+
await renderPage();
|
|
613
|
+
const row = within(screen.getByTestId("inbox-all")).getAllByTestId("inbox-all-row")[0]!;
|
|
614
|
+
const time = row.querySelector("time");
|
|
615
|
+
expect(time).toHaveAttribute("dateTime", "2026-09-11T03:30:00.000Z");
|
|
616
|
+
// jest pins UTC, the zone the server renders in.
|
|
617
|
+
expect(time).toHaveTextContent(/^Sep 11$/);
|
|
618
|
+
expect(row).toHaveTextContent("· Sep 11");
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
it("re-reads each row's day in the viewer's zone once the browser has one (#11175)", async () => {
|
|
622
|
+
const real = Intl.DateTimeFormat.prototype.resolvedOptions;
|
|
623
|
+
jest
|
|
624
|
+
.spyOn(Intl.DateTimeFormat.prototype, "resolvedOptions")
|
|
625
|
+
.mockImplementation(function resolvedOptions(this: Intl.DateTimeFormat) {
|
|
626
|
+
return { ...real.call(this), timeZone: "America/Denver" };
|
|
627
|
+
});
|
|
628
|
+
mockMemberAppointments.mockResolvedValue({
|
|
629
|
+
ok: true,
|
|
630
|
+
body: {
|
|
631
|
+
upcoming: [appointment("appt_1", "Kickoff call", "2026-09-11T03:30:00.000Z")],
|
|
632
|
+
past: [],
|
|
633
|
+
},
|
|
634
|
+
});
|
|
635
|
+
await renderPage();
|
|
636
|
+
const row = within(screen.getByTestId("inbox-all")).getAllByTestId("inbox-all-row")[0]!;
|
|
637
|
+
// 03:30Z on the 11th is still the evening of the 10th in Mountain time.
|
|
638
|
+
expect(row.querySelector("time")).toHaveTextContent(/^Sep 10$/);
|
|
639
|
+
expect(row.querySelector("time")).toHaveAttribute("title", "MDT");
|
|
640
|
+
});
|
|
641
|
+
|
|
524
642
|
it("each All row links to its item page, prefixed off the default locale", async () => {
|
|
525
643
|
accountExperimentKeys.push("ailk-founder-diagnostic");
|
|
526
644
|
await renderPage("fr");
|
|
@@ -561,7 +679,7 @@ describe("the Inbox — tabs All · Purchases · Scheduled (#8231 D3, AC-3)", ()
|
|
|
561
679
|
]);
|
|
562
680
|
});
|
|
563
681
|
|
|
564
|
-
it("a kind declaring section purchases lands under
|
|
682
|
+
it("a kind declaring section purchases lands under Orders (the `purchases` tab), not Scheduled", async () => {
|
|
565
683
|
const licence: (typeof accountInboxKinds)[number] = {
|
|
566
684
|
kind: "licence",
|
|
567
685
|
label: "purchases.heading",
|
|
@@ -594,7 +712,8 @@ describe("the Inbox — tabs All · Purchases · Scheduled (#8231 D3, AC-3)", ()
|
|
|
594
712
|
await renderPage();
|
|
595
713
|
expect(screen.getAllByRole("tab").map((tab) => tab.textContent)).toEqual([
|
|
596
714
|
"All0",
|
|
597
|
-
"
|
|
715
|
+
"Messages0",
|
|
716
|
+
"Orders0",
|
|
598
717
|
"Scheduled0",
|
|
599
718
|
]);
|
|
600
719
|
expect(screen.getByTestId("inbox-empty")).toHaveTextContent(
|
|
@@ -618,6 +737,29 @@ describe("For-you items, not Inbox rows (AC-7, D9 as amended)", () => {
|
|
|
618
737
|
).not.toBeInTheDocument();
|
|
619
738
|
});
|
|
620
739
|
|
|
740
|
+
it("#11150 — a welcomed member with no name sees the one non-dismissible name step, not the area's own item too", async () => {
|
|
741
|
+
mockGetSession.mockResolvedValue({ user: { ...SESSION.user, name: "" } });
|
|
742
|
+
mockMemberWelcome.mockResolvedValue({
|
|
743
|
+
ok: true,
|
|
744
|
+
body: {
|
|
745
|
+
welcomedAt: "2026-11-08T09:00:00.000Z",
|
|
746
|
+
steps: [
|
|
747
|
+
{ id: "name", done: false },
|
|
748
|
+
{ id: "email", done: true },
|
|
749
|
+
{ id: "booking", done: true },
|
|
750
|
+
],
|
|
751
|
+
},
|
|
752
|
+
});
|
|
753
|
+
await renderPage("en", "for-you");
|
|
754
|
+
const forYou = screen.getByTestId("inbox-panel-for-you");
|
|
755
|
+
const items = within(forYou).getAllByTestId("for-you-item");
|
|
756
|
+
expect(items.map((item) => item.getAttribute("data-item-id"))).toEqual(["onboarding:name"]);
|
|
757
|
+
expect(items[0]).toHaveTextContent("Add your name");
|
|
758
|
+
expect(within(items[0]!).queryByTestId("for-you-dismiss")).toBeNull();
|
|
759
|
+
// The default locale carries no prefix (`localeHref`).
|
|
760
|
+
expect(within(items[0]!).getByTestId("for-you-open")).toHaveAttribute("href", "/account/general");
|
|
761
|
+
});
|
|
762
|
+
|
|
621
763
|
it("a member with no name sees 'Add your name' (needs-you, Open → User settings › General)", async () => {
|
|
622
764
|
mockGetSession.mockResolvedValue({ user: { ...SESSION.user, name: "" } });
|
|
623
765
|
await renderPage("en", "for-you");
|
|
@@ -658,16 +800,13 @@ describe("the phone Inbox tab (#7469, DESIGN.md §2b · §5.15)", () => {
|
|
|
658
800
|
expect(screen.getByTestId("inbox-panel-for-you")).toHaveClass("hidden");
|
|
659
801
|
});
|
|
660
802
|
|
|
661
|
-
it("the phone has no large title
|
|
803
|
+
it("the phone has no large title — it stays at md+; no lead renders on any width (#11149)", async () => {
|
|
662
804
|
await renderPage();
|
|
663
805
|
expect(screen.getByRole("heading", { level: 1 })).toHaveClass(
|
|
664
806
|
"max-md:sr-only",
|
|
665
807
|
);
|
|
666
808
|
expect(screen.getByRole("heading", { level: 1 })).not.toHaveClass("hidden");
|
|
667
|
-
expect(screen.
|
|
668
|
-
"hidden",
|
|
669
|
-
"md:block",
|
|
670
|
-
);
|
|
809
|
+
expect(screen.queryByText("What changed, and what's coming.")).toBeNull();
|
|
671
810
|
});
|
|
672
811
|
|
|
673
812
|
it("the list sits in a bordered card, inset by the canvas on every side", async () => {
|
|
@@ -683,6 +822,50 @@ describe("the phone Inbox tab (#7469, DESIGN.md §2b · §5.15)", () => {
|
|
|
683
822
|
});
|
|
684
823
|
});
|
|
685
824
|
|
|
825
|
+
describe("#11149 — Orders on both, All first, no lead, ?tab=", () => {
|
|
826
|
+
const catalog: { account: Record<string, unknown> & { inbox: Record<string, unknown> } } =
|
|
827
|
+
require("../../../../../messages/en.json");
|
|
828
|
+
|
|
829
|
+
it("every member-area string reads Orders, never Purchases; the `purchases` tab key reads Orders", () => {
|
|
830
|
+
expect(JSON.stringify(catalog.account)).not.toContain("Purchases");
|
|
831
|
+
expect((catalog.account.inbox.tabs as Record<string, string>).purchases).toBe("Orders");
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
it("the `purchases` section id, the `purchase` kind and its member read are unchanged — the tab is relabelled, not re-keyed", async () => {
|
|
835
|
+
const purchase = accountInboxKinds.find((kind) => kind.kind === "purchase");
|
|
836
|
+
expect(purchase?.section).toBe("purchases");
|
|
837
|
+
await renderPage();
|
|
838
|
+
expect(screen.getByTestId("inbox-tab-purchases")).toHaveTextContent("Orders1");
|
|
839
|
+
expect(mockMemberPurchases).toHaveBeenCalled();
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
it("renders no lead: the key is gone from the catalog, nothing reads it, and the tabs follow the title row at the list's own mt-block-loose — the Admin's token", async () => {
|
|
843
|
+
expect(catalog.account.inbox.lead).toBeUndefined();
|
|
844
|
+
await renderPage();
|
|
845
|
+
const panel = screen.getByTestId("inbox-panel-inbox");
|
|
846
|
+
const list = screen.getByTestId("inbox-list");
|
|
847
|
+
expect(panel.firstElementChild).toBe(list);
|
|
848
|
+
expect(list).toHaveClass("mt-block-loose");
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
it("?tab= opens Messages or All; an unknown value or the phone's for-you opens All", async () => {
|
|
852
|
+
await renderPage("en", "inbox", { tab: "messages" });
|
|
853
|
+
expect(screen.getByTestId("inbox-tab-messages")).toHaveAttribute("aria-selected", "true");
|
|
854
|
+
cleanupRender();
|
|
855
|
+
await renderPage("en", "inbox", { tab: "all" });
|
|
856
|
+
expect(screen.getByTestId("inbox-tab-all")).toHaveAttribute("aria-selected", "true");
|
|
857
|
+
cleanupRender();
|
|
858
|
+
await renderPage("en", "inbox", { tab: "purchases" });
|
|
859
|
+
expect(screen.getByTestId("inbox-tab-purchases")).toHaveAttribute("aria-selected", "true");
|
|
860
|
+
cleanupRender();
|
|
861
|
+
await renderPage("en", "for-you", { tab: "for-you" });
|
|
862
|
+
expect(screen.getByTestId("inbox-tab-all")).toHaveAttribute("aria-selected", "true");
|
|
863
|
+
cleanupRender();
|
|
864
|
+
await renderPage("en", "inbox", { tab: ["bogus", "messages"] });
|
|
865
|
+
expect(screen.getByTestId("inbox-tab-all")).toHaveAttribute("aria-selected", "true");
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
|
|
686
869
|
describe("the phone For you tab (#7469, DESIGN.md §2b · §5.15)", () => {
|
|
687
870
|
it("lists every item with its type tag, title, Open or View, and ✕", async () => {
|
|
688
871
|
UNVERIFIED_AND_PAST_DUE();
|