@remit/ui 0.0.221 → 0.0.223
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/package.json +14 -3
- package/src/components/DropdownMenu.tsx +100 -0
- package/src/components/EmptyState.tsx +11 -0
- package/src/components/ErrorBanner.render.test.ts +107 -0
- package/src/components/ErrorBanner.stories.tsx +132 -0
- package/src/components/ErrorBanner.tsx +122 -0
- package/src/components/ErrorBannerStack.tsx +34 -0
- package/src/components/ErrorState.render.test.ts +82 -0
- package/src/components/ErrorState.tsx +80 -0
- package/src/components/KeyboardShortcutsModal.tsx +111 -0
- package/src/components/account-service-change-dialog.render.test.ts +1 -41
- package/src/components/account-service-choice.render.test.ts +0 -26
- package/src/components/account-service-toggles.render.test.ts +0 -6
- package/src/components/address-display.render.test.ts +1 -38
- package/src/components/address-tag.render.test.ts +0 -11
- package/src/components/agenda-flow.reach.test.ts +0 -8
- package/src/components/agenda-flow.render.test.ts +0 -31
- package/src/components/agenda-panels.render.test.ts +0 -5
- package/src/components/app-shell-slotted.render.test.ts +0 -118
- package/src/components/attachment-list.render.test.ts +41 -24
- package/src/components/attachment-list.stories.tsx +67 -0
- package/src/components/attachment-list.tsx +112 -35
- package/src/components/attendee-row.render.test.ts +0 -41
- package/src/components/attention-dot.stories.tsx +46 -0
- package/src/components/attention-dot.tsx +23 -0
- package/src/components/banner.render.test.ts +0 -7
- package/src/components/bottom-sheet.render.test.ts +0 -42
- package/src/components/brief-section.render.test.ts +0 -13
- package/src/components/brief-sections.keyboard.test.ts +0 -13
- package/src/components/brief-sections.render.test.ts +0 -22
- package/src/components/calendar-clash-strip.render.test.ts +0 -19
- package/src/components/calendar-grid.render.test.ts +0 -79
- package/src/components/calendar-invite-card.render.test.ts +0 -19
- package/src/components/calendar-list.render.test.ts +0 -21
- package/src/components/calendar-slot-offers.render.test.ts +0 -24
- package/src/components/calendar-suggestion-deck.render.test.ts +0 -18
- package/src/components/calendar-toolbar.render.test.ts +1 -53
- package/src/components/category-badge.render.test.ts +1 -24
- package/src/components/compose-action-bar.render.test.ts +0 -5
- package/src/components/compose-attachments.render.test.ts +0 -38
- package/src/components/event-detail.render.test.ts +0 -27
- package/src/components/event-editor.render.test.ts +0 -4
- package/src/components/event-suggestion-card.render.test.ts +0 -61
- package/src/components/event-suggestion-card.zone-gate.test.ts +1 -7
- package/src/components/filter-clause-chip.tsx +1 -60
- package/src/components/filter-rule-editor.create.test.ts +0 -6
- package/src/components/filter-rule-editor.stories.tsx +24 -138
- package/src/components/filter-rule-editor.tsx +7 -93
- package/src/components/filter-rule.render.test.ts +9 -299
- package/src/components/filter-rule.ts +20 -85
- package/src/components/filter-sheet.render.test.ts +0 -7
- package/src/components/folder-manage-actions.render.test.ts +0 -13
- package/src/components/folder-manager.render.test.ts +0 -31
- package/src/components/folder-mutation-dialog.render.test.ts +0 -83
- package/src/components/folder-rename-dialog.render.test.ts +0 -14
- package/src/components/folder-row.render.test.ts +0 -30
- package/src/components/folder-sync-state.test.ts +0 -61
- package/src/components/folder-tree-picker.create.test.ts +0 -30
- package/src/components/folder-tree-picker.render.test.ts +0 -35
- package/src/components/intelligence-calendar-fixtures.ts +0 -2
- package/src/components/intelligence-calendar.render.test.ts +0 -4
- package/src/components/intelligence-panel.render.test.ts +1 -62
- package/src/components/intelligence-panel.stories.tsx +0 -76
- package/src/components/intelligence-panel.tab-strip.test.ts +0 -1
- package/src/components/intelligence-panel.tsx +6 -176
- package/src/components/intelligence-toggle.render.test.ts +0 -5
- package/src/components/isolated-email-frame.render.test.ts +0 -122
- package/src/components/isolated-email-frame.tsx +55 -3
- package/src/components/keyboard-hint-bar.render.test.ts +0 -7
- package/src/components/label-chip.render.test.ts +0 -28
- package/src/components/label-chip.tsx +1 -1
- package/src/components/mail-header.render.test.ts +0 -20
- package/src/components/mcp-connected-apps-page.stories.tsx +58 -0
- package/src/components/mcp-connected-apps-page.tsx +79 -0
- package/src/components/mcp-consent-page.stories.tsx +39 -0
- package/src/components/mcp-consent-page.tsx +47 -0
- package/src/components/mcp-device-page.stories.tsx +57 -0
- package/src/components/mcp-device-page.tsx +107 -0
- package/src/components/mcp-error-notice.stories.tsx +34 -0
- package/src/components/mcp-error-notice.tsx +23 -0
- package/src/components/mcp-error-page.stories.tsx +17 -0
- package/src/components/mcp-error-page.tsx +15 -0
- package/src/components/mcp-fixtures.ts +16 -0
- package/src/components/mcp-login-page.stories.tsx +37 -0
- package/src/components/mcp-login-page.tsx +58 -0
- package/src/components/mcp-page.stories.tsx +27 -0
- package/src/components/mcp-page.tsx +35 -0
- package/src/components/mcp-permission-list.stories.tsx +21 -0
- package/src/components/mcp-permission-list.tsx +22 -0
- package/src/components/message-body-view.render.test.ts +0 -21
- package/src/components/message-list-pane.brief-filter.test.ts +0 -6
- package/src/components/message-list-pane.render.test.ts +0 -54
- package/src/components/message-list-state.render.test.ts +0 -84
- package/src/components/{quarantine-bug-dialog.tsx → message-report-dialog.tsx} +9 -14
- package/src/components/message-row.render.test.ts +1 -98
- package/src/components/mobile-message-action-bar.render.test.ts +0 -59
- package/src/components/mobile-reading-pane.render.test.ts +0 -48
- package/src/components/mobile-reading-pane.stories.tsx +78 -0
- package/src/components/mobile-reading-pane.tsx +55 -41
- package/src/components/mobile-search-view.render.test.ts +0 -16
- package/src/components/mobile-search-view.stories.tsx +8 -11
- package/src/components/mobile-search-view.tsx +1 -1
- package/src/components/nav-sidebar.keyboard.test.ts +0 -8
- package/src/components/nav-sidebar.render.test.ts +2 -133
- package/src/components/new-folder-form.render.test.ts +0 -26
- package/src/components/outbox-row.render.test.ts +0 -9
- package/src/components/pane-layout.render.test.ts +0 -18
- package/src/components/plain-text-editor.mount.test.ts +0 -16
- package/src/components/popover-menu.render.test.ts +0 -11
- package/src/components/progress-bar.render.test.ts +0 -14
- package/src/components/quarantine-report.test.ts +0 -8
- package/src/components/quarantine-section.render.test.ts +16 -13
- package/src/components/quarantine-section.stories.tsx +11 -8
- package/src/components/reading-pane.render.test.ts +2 -106
- package/src/components/reading-pane.stories.tsx +3 -0
- package/src/components/refresh-button.render.test.ts +0 -9
- package/src/components/rescue-from-spam-flow.render.test.ts +0 -24
- package/src/components/rich-text-editor.mount.test.ts +0 -19
- package/src/components/rich-text-image-node.ts +11 -9
- package/src/components/role-appointment-list.render.test.ts +0 -49
- package/src/components/role-appointment-prompt.render.test.ts +0 -79
- package/src/components/row-actions.render.test.ts +0 -34
- package/src/components/search-bar.render.test.ts +0 -44
- package/src/components/search-chip-input.render.test.ts +0 -71
- package/src/components/search-conversion-notice.stories.tsx +0 -6
- package/src/components/search-conversion-notice.tsx +3 -9
- package/src/components/search-conversion.render.test.ts +0 -52
- package/src/components/search-conversion.ts +2 -18
- package/src/components/search-result-row.tsx +5 -26
- package/src/components/search-results.render.test.ts +0 -68
- package/src/components/search-results.stories.tsx +0 -30
- package/src/components/search-results.tsx +1 -1
- package/src/components/security-select.render.test.ts +1 -14
- package/src/components/selection-top-bar.render.test.ts +0 -180
- package/src/components/selection-wizard-fixtures.ts +0 -2
- package/src/components/selection-wizard.render.test.ts +7 -212
- package/src/components/selection-wizard.stories.tsx +24 -164
- package/src/components/selection-wizard.tsx +10 -86
- package/src/components/self-update.render.test.ts +0 -113
- package/src/components/sender-trust-indicator.render.test.ts +0 -30
- package/src/components/shell-top-bar.render.test.ts +0 -31
- package/src/components/shell-top-bar.stories.tsx +7 -0
- package/src/components/shell-top-bar.tsx +11 -2
- package/src/components/slide-panel.render.test.ts +0 -18
- package/src/components/suggest-list.render.test.ts +0 -6
- package/src/components/swipeable-row.gesture.test.ts +85 -40
- package/src/components/swipeable-row.render.test.ts +0 -7
- package/src/components/swipeable-row.stories.tsx +3 -2
- package/src/components/swipeable-row.tsx +65 -144
- package/src/components/sync-warning-fixtures.ts +22 -0
- package/src/components/sync-warning-report.ts +38 -0
- package/src/components/sync-warning-row.tsx +51 -0
- package/src/components/sync-warning-section.render.test.ts +19 -0
- package/src/components/sync-warning-section.stories.tsx +94 -0
- package/src/components/sync-warning-section.tsx +56 -0
- package/src/components/touch-list-body.render.test.ts +0 -29
- package/src/components/wizard.render.test.ts +0 -22
- package/src/filter-presets.test.ts +1 -107
- package/src/index.ts +40 -34
- package/src/lib/compose-language.test.ts +0 -11
- package/src/lib/email-render-treatment.test.ts +0 -21
- package/src/lib/keymap.test.ts +0 -32
- package/src/lib/property-prefill.ts +2 -2
- package/src/lib/search-rule.test.ts +0 -4
- package/src/lib/search-rule.ts +0 -9
- package/src/lib/sender-derivation.ts +3 -5
- package/src/lib/swipe-config.ts +11 -0
- package/src/lib/use-list-cursor.test.ts +0 -7
- package/src/lib/use-list-keyboard.test.ts +0 -14
- package/src/lib/use-long-press.test.ts +53 -36
- package/src/lib/use-long-press.ts +62 -56
- package/src/lib/use-modal-focus.test.ts +0 -20
- package/src/lib/use-selection.hook.test.ts +0 -13
- package/src/lib/use-selection.test.ts +0 -101
- package/src/lib/use-swipe-navigation.test.ts +162 -0
- package/src/lib/use-swipe-navigation.ts +90 -0
- package/src/lib/wizard-steps.test.ts +18 -79
- package/src/lib/wizard-steps.ts +27 -67
- package/src/mcp-pages.ts +36 -0
- package/src/category-presentation.test.ts +0 -76
- package/src/components/account-service-status.render.test.ts +0 -82
- package/src/components/app-password-hint.render.test.ts +0 -23
- package/src/components/app-top-bar.render.test.ts +0 -59
- package/src/components/auth-card.render.test.ts +0 -24
- package/src/components/auth-footer.render.test.ts +0 -17
- package/src/components/auth-hero.render.test.ts +0 -31
- package/src/components/auto-moved-badge.render.test.ts +0 -65
- package/src/components/button.render.test.ts +0 -29
- package/src/components/calendar-event-chip.render.test.ts +0 -67
- package/src/components/calendar-parse-badge.render.test.ts +0 -40
- package/src/components/checkbox.render.test.ts +0 -65
- package/src/components/compose-form-shell.render.test.ts +0 -106
- package/src/components/dialog.render.test.ts +0 -51
- package/src/components/field-label.render.test.ts +0 -16
- package/src/components/mail-action-toolbar.render.test.ts +0 -43
- package/src/components/nav-link-surface.render.test.ts +0 -126
- package/src/components/new-folder-action.render.test.ts +0 -44
- package/src/components/pane-header.render.test.ts +0 -22
- package/src/components/pull-to-refresh.render.test.ts +0 -46
- package/src/components/recurrence-scope-prompt.render.test.ts +0 -36
- package/src/components/rescue-banner.render.test.ts +0 -32
- package/src/components/rescue-candidate-row.render.test.ts +0 -68
- package/src/components/search-token-chip.render.test.ts +0 -42
- package/src/components/self-update-dot.tsx +0 -32
- package/src/components/settings-primitives.render.test.ts +0 -160
- package/src/lib/email-layout-clamp.test.ts +0 -139
- package/src/lib/label-color.test.ts +0 -25
- package/src/lib/semantic-off.ts +0 -20
- package/src/stories-viewport-globals.test.ts +0 -77
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How a switched-off service reads wherever its account or its stored rows are
|
|
3
|
-
* (#1179). Every surface says the same thing, and the notice over stored rows
|
|
4
|
-
* says what stayed before it says what stopped.
|
|
5
|
-
*/
|
|
6
|
-
import "@remit/test-dom";
|
|
7
|
-
import assert from "node:assert/strict";
|
|
8
|
-
import { describe, it } from "node:test";
|
|
9
|
-
import { createElement } from "react";
|
|
10
|
-
import { renderToString } from "react-dom/server";
|
|
11
|
-
import {
|
|
12
|
-
AccountServiceOffBadge,
|
|
13
|
-
AccountServiceOffNotice,
|
|
14
|
-
} from "./account-service-status.js";
|
|
15
|
-
|
|
16
|
-
describe("AccountServiceOffBadge", () => {
|
|
17
|
-
it("labels a mail-disabled account", () => {
|
|
18
|
-
assert.match(
|
|
19
|
-
renderToString(
|
|
20
|
-
createElement(AccountServiceOffBadge, { service: "Mail" }),
|
|
21
|
-
),
|
|
22
|
-
/mail sync off/,
|
|
23
|
-
);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("labels a calendar-disabled account", () => {
|
|
27
|
-
assert.match(
|
|
28
|
-
renderToString(
|
|
29
|
-
createElement(AccountServiceOffBadge, { service: "Calendar" }),
|
|
30
|
-
),
|
|
31
|
-
/calendar sync off/,
|
|
32
|
-
);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe("AccountServiceOffNotice", () => {
|
|
37
|
-
it("says the stored mail is there before it says sync stopped", () => {
|
|
38
|
-
const html = renderToString(
|
|
39
|
-
createElement(AccountServiceOffNotice, { service: "Mail" }),
|
|
40
|
-
);
|
|
41
|
-
assert.match(html, /Everything already synced is here to read/);
|
|
42
|
-
assert.ok(
|
|
43
|
-
html.indexOf("here to read") < html.indexOf("nothing new arrives"),
|
|
44
|
-
);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("keeps a paused calendar's events on the calendar", () => {
|
|
48
|
-
assert.match(
|
|
49
|
-
renderToString(
|
|
50
|
-
createElement(AccountServiceOffNotice, { service: "Calendar" }),
|
|
51
|
-
),
|
|
52
|
-
/Its events stay on your calendar/,
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("states the account rather than raising an alarm", () => {
|
|
57
|
-
assert.match(
|
|
58
|
-
renderToString(
|
|
59
|
-
createElement(AccountServiceOffNotice, { service: "Mail" }),
|
|
60
|
-
),
|
|
61
|
-
/role="status"/,
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("offers the way back on only when it is given one", () => {
|
|
66
|
-
assert.doesNotMatch(
|
|
67
|
-
renderToString(
|
|
68
|
-
createElement(AccountServiceOffNotice, { service: "Mail" }),
|
|
69
|
-
),
|
|
70
|
-
/Turn mail back on/,
|
|
71
|
-
);
|
|
72
|
-
assert.match(
|
|
73
|
-
renderToString(
|
|
74
|
-
createElement(AccountServiceOffNotice, {
|
|
75
|
-
service: "Mail",
|
|
76
|
-
onEnable: () => {},
|
|
77
|
-
}),
|
|
78
|
-
),
|
|
79
|
-
/Turn mail back on/,
|
|
80
|
-
);
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { AppPasswordHint } from "./app-password-hint.js";
|
|
6
|
-
|
|
7
|
-
describe("AppPasswordHint", () => {
|
|
8
|
-
it("renders a deep link when a url is provided", () => {
|
|
9
|
-
const html = renderToString(
|
|
10
|
-
createElement(AppPasswordHint, {
|
|
11
|
-
url: "https://support.apple.com/en-us/102654",
|
|
12
|
-
}),
|
|
13
|
-
);
|
|
14
|
-
assert.match(html, /href="https:\/\/support\.apple\.com\/en-us\/102654"/);
|
|
15
|
-
assert.match(html, /How to create an app password/);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("renders the generic fallback when no url is provided", () => {
|
|
19
|
-
const html = renderToString(createElement(AppPasswordHint, {}));
|
|
20
|
-
assert.doesNotMatch(html, /<a /);
|
|
21
|
-
assert.match(html, /Check your provider.*help for app password/);
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { AppTopBar, type AppTopBarProps } from "./app-top-bar.js";
|
|
6
|
-
|
|
7
|
-
const slot = (testId: string) =>
|
|
8
|
-
createElement("div", { "data-testid": testId }, testId);
|
|
9
|
-
|
|
10
|
-
const render = (overrides: Partial<AppTopBarProps> = {}): string =>
|
|
11
|
-
renderToString(
|
|
12
|
-
createElement(AppTopBar, {
|
|
13
|
-
search: slot("search"),
|
|
14
|
-
...overrides,
|
|
15
|
-
}),
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
describe("AppTopBar", () => {
|
|
19
|
-
it("renders the search slot — the bar's reason to exist", () => {
|
|
20
|
-
assert.match(render(), /data-testid="search"/);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("renders the action slot when supplied", () => {
|
|
24
|
-
const html = render({ actions: slot("actions") });
|
|
25
|
-
assert.match(html, /data-testid="actions"/);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("omits the actions entirely rather than leaving an empty box", () => {
|
|
29
|
-
assert.doesNotMatch(render(), /data-testid="actions"/);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("lays the bar out leading · search · actions", () => {
|
|
33
|
-
const html = render({ leading: slot("leading"), actions: slot("actions") });
|
|
34
|
-
assert.ok(
|
|
35
|
-
html.indexOf("leading") < html.indexOf("search") &&
|
|
36
|
-
html.indexOf("search") < html.indexOf("actions"),
|
|
37
|
-
"slots render in reading order",
|
|
38
|
-
);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it("omits the leading box when no control is supplied", () => {
|
|
42
|
-
assert.doesNotMatch(render(), /data-testid="leading"/);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("widens the field on focus rather than resting wide", () => {
|
|
46
|
-
const html = render();
|
|
47
|
-
assert.match(html, /max-w-xs/, "resting width is modest");
|
|
48
|
-
assert.match(html, /focus-within:max-w-lg/, "focus widens it");
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("carries no brand mark — the bar is search, not a masthead", () => {
|
|
52
|
-
assert.doesNotMatch(render(), /remit/i);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("is a banner landmark spanning the app, not a pane header", () => {
|
|
56
|
-
assert.match(render(), /<header/);
|
|
57
|
-
assert.match(render(), /w-full/);
|
|
58
|
-
});
|
|
59
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { AuthCard } from "./auth-card.js";
|
|
6
|
-
|
|
7
|
-
describe("AuthCard", () => {
|
|
8
|
-
it("carries data-auth-page so the Amplify overrides apply", () => {
|
|
9
|
-
const html = renderToString(createElement(AuthCard, null, "form"));
|
|
10
|
-
assert.match(html, /data-auth-page/);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("renders the radial-gradient page frame", () => {
|
|
14
|
-
const html = renderToString(createElement(AuthCard, null, "form"));
|
|
15
|
-
assert.match(html, /radial-gradient/);
|
|
16
|
-
assert.match(html, /min-h-dvh/);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("centres a max-width card column around its children", () => {
|
|
20
|
-
const html = renderToString(createElement(AuthCard, null, "SIGNIN"));
|
|
21
|
-
assert.match(html, /max-w-\[26rem\]/);
|
|
22
|
-
assert.match(html, /SIGNIN/);
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { renderToString } from "react-dom/server";
|
|
4
|
-
import { AuthFooter } from "./auth-footer.js";
|
|
5
|
-
|
|
6
|
-
describe("AuthFooter", () => {
|
|
7
|
-
it("renders a provider-neutral note by default", () => {
|
|
8
|
-
const html = renderToString(AuthFooter());
|
|
9
|
-
assert.match(html, /Secure sign-in/);
|
|
10
|
-
assert.doesNotMatch(html, /Cognito/);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it("renders a custom note", () => {
|
|
14
|
-
const html = renderToString(AuthFooter({ note: "Custom" }));
|
|
15
|
-
assert.match(html, /Custom/);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { AuthHero } from "./auth-hero.js";
|
|
6
|
-
|
|
7
|
-
describe("AuthHero", () => {
|
|
8
|
-
it("renders the default wordmark, tagline, and envelope mark", () => {
|
|
9
|
-
const html = renderToString(createElement(AuthHero));
|
|
10
|
-
assert.match(html, /remit,/);
|
|
11
|
-
assert.match(html, /your email client in the cloud\./);
|
|
12
|
-
assert.match(html, /<svg/);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("renders custom wordmark and tagline", () => {
|
|
16
|
-
const html = renderToString(
|
|
17
|
-
createElement(AuthHero, {
|
|
18
|
-
wordmark: "acme,",
|
|
19
|
-
tagline: "mail, reimagined.",
|
|
20
|
-
}),
|
|
21
|
-
);
|
|
22
|
-
assert.match(html, /acme,/);
|
|
23
|
-
assert.match(html, /mail, reimagined\./);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("is NOT wrapped in an Amplify router slot — it floats above the card", () => {
|
|
27
|
-
const html = renderToString(createElement(AuthHero));
|
|
28
|
-
assert.doesNotMatch(html, /data-amplify-router/);
|
|
29
|
-
assert.doesNotMatch(html, /data-amplify/);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { AutoMovedBadge } from "./auto-moved-badge.js";
|
|
6
|
-
|
|
7
|
-
describe("AutoMovedBadge", () => {
|
|
8
|
-
it("renders the label", () => {
|
|
9
|
-
const html = renderToString(
|
|
10
|
-
createElement(AutoMovedBadge, { label: "Moved from Junk by Remit" }),
|
|
11
|
-
);
|
|
12
|
-
assert.match(html, /Moved from Junk by Remit/);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("renders no Undo action when onUndo is omitted", () => {
|
|
16
|
-
const html = renderToString(
|
|
17
|
-
createElement(AutoMovedBadge, { label: "Moved from Junk by Remit" }),
|
|
18
|
-
);
|
|
19
|
-
assert.doesNotMatch(html, /Undo/);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("renders an Undo action when onUndo is provided", () => {
|
|
23
|
-
const html = renderToString(
|
|
24
|
-
createElement(AutoMovedBadge, {
|
|
25
|
-
label: "Moved from Junk by Remit",
|
|
26
|
-
onUndo: () => undefined,
|
|
27
|
-
}),
|
|
28
|
-
);
|
|
29
|
-
assert.match(html, /Undo/);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("renders a custom undo label", () => {
|
|
33
|
-
const html = renderToString(
|
|
34
|
-
createElement(AutoMovedBadge, {
|
|
35
|
-
label: "Moved from Junk by Remit",
|
|
36
|
-
onUndo: () => undefined,
|
|
37
|
-
undoLabel: "Move back to Junk",
|
|
38
|
-
}),
|
|
39
|
-
);
|
|
40
|
-
assert.match(html, /Move back to Junk/);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("renders no filter link when filtersHref is omitted (classifier move)", () => {
|
|
44
|
-
const html = renderToString(
|
|
45
|
-
createElement(AutoMovedBadge, {
|
|
46
|
-
label: "Moved from Junk by Remit",
|
|
47
|
-
onUndo: () => undefined,
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
50
|
-
assert.doesNotMatch(html, /Manage filter/);
|
|
51
|
-
assert.doesNotMatch(html, /settings\/filters/);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("renders a Manage filter link to Settings when filtersHref is set", () => {
|
|
55
|
-
const html = renderToString(
|
|
56
|
-
createElement(AutoMovedBadge, {
|
|
57
|
-
label: "Moved from Inbox by Remit",
|
|
58
|
-
onUndo: () => undefined,
|
|
59
|
-
filtersHref: "/settings/filters",
|
|
60
|
-
}),
|
|
61
|
-
);
|
|
62
|
-
assert.match(html, /Manage filter/);
|
|
63
|
-
assert.match(html, /href="\/settings\/filters"/);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { Button } from "./button.js";
|
|
6
|
-
|
|
7
|
-
describe("Button", () => {
|
|
8
|
-
it("defaults to the md size", () => {
|
|
9
|
-
const html = renderToString(createElement(Button, {}, "Save"));
|
|
10
|
-
assert.match(html, /h-9/);
|
|
11
|
-
assert.doesNotMatch(html, /h-11/);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it("renders the sm size at 28px", () => {
|
|
15
|
-
const html = renderToString(createElement(Button, { size: "sm" }, "Save"));
|
|
16
|
-
assert.match(html, /h-7/);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it("renders the touch size at 44px square", () => {
|
|
20
|
-
const html = renderToString(
|
|
21
|
-
createElement(Button, {
|
|
22
|
-
size: "touch",
|
|
23
|
-
"aria-label": "Delete",
|
|
24
|
-
}),
|
|
25
|
-
);
|
|
26
|
-
assert.match(html, /h-11/);
|
|
27
|
-
assert.match(html, /w-11/);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import {
|
|
6
|
-
CalendarEventChip,
|
|
7
|
-
type CalendarEventChipProps,
|
|
8
|
-
} from "./calendar-event-chip.js";
|
|
9
|
-
|
|
10
|
-
const base: CalendarEventChipProps = {
|
|
11
|
-
title: "Q3 roadmap review",
|
|
12
|
-
timeText: "10:00",
|
|
13
|
-
color: "cal-1",
|
|
14
|
-
layout: "row",
|
|
15
|
-
density: "comfortable",
|
|
16
|
-
rsvp: "accepted",
|
|
17
|
-
status: "confirmed",
|
|
18
|
-
hasThread: false,
|
|
19
|
-
isRecurring: false,
|
|
20
|
-
zoneCertainty: "local",
|
|
21
|
-
selected: false,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const render = (props: Partial<CalendarEventChipProps>) =>
|
|
25
|
-
renderToString(createElement(CalendarEventChip, { ...base, ...props }));
|
|
26
|
-
|
|
27
|
-
describe("CalendarEventChip", () => {
|
|
28
|
-
it("carries the calendar's hue and nothing else coloured", () => {
|
|
29
|
-
const html = render({ color: "cal-3" });
|
|
30
|
-
assert.match(html, /bg-cal-3-soft/);
|
|
31
|
-
assert.match(html, /text-cal-3/);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("renders the time ahead of the title", () => {
|
|
35
|
-
const html = render({});
|
|
36
|
-
assert.match(html, /10:00/);
|
|
37
|
-
assert.match(html, /Q3 roadmap review/);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("omits the time for an all-day entry", () => {
|
|
41
|
-
const html = render({ timeText: "" });
|
|
42
|
-
assert.doesNotMatch(html, /tabular-nums/);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
it("strikes a declined event rather than recolouring it", () => {
|
|
46
|
-
const html = render({ rsvp: "declined" });
|
|
47
|
-
assert.match(html, /line-through/);
|
|
48
|
-
assert.match(html, /bg-cal-1-soft/);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("dashes the border of a tentative event", () => {
|
|
52
|
-
const html = render({ status: "tentative" });
|
|
53
|
-
assert.match(html, /border-dashed/);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it("marks an event that came from mail", () => {
|
|
57
|
-
assert.match(render({ hasThread: true }), /From mail/);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("marks a repeating event", () => {
|
|
61
|
-
assert.match(render({ isRecurring: true }), /Repeats/);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it("flags a zone it could not determine", () => {
|
|
65
|
-
assert.match(render({ zoneCertainty: "ambiguous" }), /Unclear zone/);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import {
|
|
6
|
-
CalendarParseBadge,
|
|
7
|
-
calendarParseLabel,
|
|
8
|
-
calendarParseNote,
|
|
9
|
-
} from "./calendar-parse-badge.js";
|
|
10
|
-
import type { CalendarParseMethod } from "./calendar-types.js";
|
|
11
|
-
|
|
12
|
-
const methods: CalendarParseMethod[] = ["ics", "markup", "pattern"];
|
|
13
|
-
|
|
14
|
-
const render = (method: CalendarParseMethod) =>
|
|
15
|
-
renderToString(createElement(CalendarParseBadge, { method }));
|
|
16
|
-
|
|
17
|
-
describe("CalendarParseBadge", () => {
|
|
18
|
-
it("names the rung that answered", () => {
|
|
19
|
-
for (const method of methods) {
|
|
20
|
-
assert.match(render(method), new RegExp(calendarParseLabel[method]));
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("marks a stated field apart from a reading of the prose", () => {
|
|
25
|
-
assert.match(render("ics"), /text-positive/);
|
|
26
|
-
assert.match(render("pattern"), /text-warning/);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it("carries a label and a note for every rung", () => {
|
|
30
|
-
for (const method of methods) {
|
|
31
|
-
assert.notEqual(calendarParseLabel[method], undefined, method);
|
|
32
|
-
assert.notEqual(calendarParseNote[method], undefined, method);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("says a prose reading can be wrong, where a copied field does not", () => {
|
|
37
|
-
assert.match(calendarParseNote.pattern, /can be wrong/);
|
|
38
|
-
assert.doesNotMatch(calendarParseNote.ics, /can be wrong/);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { Checkbox } from "./checkbox.js";
|
|
6
|
-
|
|
7
|
-
const noop = () => {};
|
|
8
|
-
|
|
9
|
-
describe("Checkbox", () => {
|
|
10
|
-
it("renders a real checkbox input", () => {
|
|
11
|
-
const html = renderToString(
|
|
12
|
-
createElement(Checkbox, {
|
|
13
|
-
"aria-label": "Select row",
|
|
14
|
-
checked: false,
|
|
15
|
-
onChange: noop,
|
|
16
|
-
}),
|
|
17
|
-
);
|
|
18
|
-
assert.match(html, /type="checkbox"/);
|
|
19
|
-
assert.match(html, /aria-label="Select row"/);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it("reflects the checked state on the input", () => {
|
|
23
|
-
const checked = renderToString(
|
|
24
|
-
createElement(Checkbox, {
|
|
25
|
-
"aria-label": "x",
|
|
26
|
-
checked: true,
|
|
27
|
-
onChange: noop,
|
|
28
|
-
}),
|
|
29
|
-
);
|
|
30
|
-
assert.match(checked, /checked=""/);
|
|
31
|
-
|
|
32
|
-
const unchecked = renderToString(
|
|
33
|
-
createElement(Checkbox, {
|
|
34
|
-
"aria-label": "x",
|
|
35
|
-
checked: false,
|
|
36
|
-
onChange: noop,
|
|
37
|
-
}),
|
|
38
|
-
);
|
|
39
|
-
assert.doesNotMatch(unchecked, /checked=""/);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("wraps in a label with the touch target when given label text", () => {
|
|
43
|
-
const html = renderToString(
|
|
44
|
-
createElement(Checkbox, {
|
|
45
|
-
label: "Keep me posted",
|
|
46
|
-
checked: false,
|
|
47
|
-
onChange: noop,
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
50
|
-
assert.match(html, /<label/);
|
|
51
|
-
assert.match(html, /min-h-11/);
|
|
52
|
-
assert.match(html, /Keep me posted/);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("renders just the control when label and description are omitted", () => {
|
|
56
|
-
const html = renderToString(
|
|
57
|
-
createElement(Checkbox, {
|
|
58
|
-
"aria-label": "bare",
|
|
59
|
-
checked: false,
|
|
60
|
-
onChange: noop,
|
|
61
|
-
}),
|
|
62
|
-
);
|
|
63
|
-
assert.doesNotMatch(html, /<label/);
|
|
64
|
-
});
|
|
65
|
-
});
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { ComposeFormShell } from "./compose-form-shell.js";
|
|
6
|
-
|
|
7
|
-
describe("ComposeFormShell", () => {
|
|
8
|
-
it("renders header, body and action bar slots in order", () => {
|
|
9
|
-
const html = renderToString(
|
|
10
|
-
createElement(ComposeFormShell, {
|
|
11
|
-
header: createElement("div", null, "HEADER"),
|
|
12
|
-
actionBar: createElement("div", null, "ACTIONBAR"),
|
|
13
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
14
|
-
children: createElement("div", null, "BODY"),
|
|
15
|
-
}),
|
|
16
|
-
);
|
|
17
|
-
assert.ok(html.indexOf("HEADER") < html.indexOf("BODY"));
|
|
18
|
-
assert.ok(html.indexOf("BODY") < html.indexOf("ACTIONBAR"));
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("renders the banner and quoted slots when supplied", () => {
|
|
22
|
-
const html = renderToString(
|
|
23
|
-
createElement(ComposeFormShell, {
|
|
24
|
-
banner: createElement("div", null, "BANNER"),
|
|
25
|
-
header: createElement("div", null, "HEADER"),
|
|
26
|
-
quoted: createElement("div", null, "QUOTED"),
|
|
27
|
-
actionBar: createElement("div", null, "BAR"),
|
|
28
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
29
|
-
children: createElement("div", null, "BODY"),
|
|
30
|
-
}),
|
|
31
|
-
);
|
|
32
|
-
assert.match(html, /BANNER/);
|
|
33
|
-
assert.match(html, /QUOTED/);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("omits the quoted region when not supplied", () => {
|
|
37
|
-
const html = renderToString(
|
|
38
|
-
createElement(ComposeFormShell, {
|
|
39
|
-
header: createElement("div", null, "H"),
|
|
40
|
-
actionBar: createElement("div", null, "B"),
|
|
41
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
42
|
-
children: createElement("div", null, "BODY"),
|
|
43
|
-
}),
|
|
44
|
-
);
|
|
45
|
-
assert.doesNotMatch(html, /pb-2/);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("scrolls the body region when it fills the height it is given", () => {
|
|
49
|
-
const html = renderToString(
|
|
50
|
-
createElement(ComposeFormShell, {
|
|
51
|
-
layout: "fill",
|
|
52
|
-
header: createElement("div", null, "H"),
|
|
53
|
-
actionBar: createElement("div", null, "B"),
|
|
54
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
55
|
-
children: createElement("div", null, "BODY"),
|
|
56
|
-
}),
|
|
57
|
-
);
|
|
58
|
-
assert.match(html, /overflow-auto/);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it("scrolls nothing when it takes the height of what is written in it", () => {
|
|
62
|
-
const html = renderToString(
|
|
63
|
-
createElement(ComposeFormShell, {
|
|
64
|
-
layout: "flow",
|
|
65
|
-
header: createElement("div", null, "H"),
|
|
66
|
-
quoted: createElement("div", null, "QUOTED"),
|
|
67
|
-
actionBar: createElement("div", null, "B"),
|
|
68
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
69
|
-
children: createElement("div", null, "BODY"),
|
|
70
|
-
}),
|
|
71
|
-
);
|
|
72
|
-
// A surface opened as a block of a page it did not bring: a scroller here
|
|
73
|
-
// is a second track in that page's column, with the caret inside it.
|
|
74
|
-
assert.doesNotMatch(html, /overflow-/);
|
|
75
|
-
assert.doesNotMatch(html, /h-full/);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it("keeps the action bar on the bottom edge while the surface grows", () => {
|
|
79
|
-
const html = renderToString(
|
|
80
|
-
createElement(ComposeFormShell, {
|
|
81
|
-
layout: "flow",
|
|
82
|
-
header: createElement("div", null, "H"),
|
|
83
|
-
actionBar: createElement("div", null, "B"),
|
|
84
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
85
|
-
children: createElement("div", null, "BODY"),
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
88
|
-
// A draft of a few paragraphs is taller than a phone, and the bar is the
|
|
89
|
-
// last thing in the surface: without this Send goes off the bottom as it
|
|
90
|
-
// is written.
|
|
91
|
-
assert.match(html, /sticky bottom-0/);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("leaves the action bar in the column when the surface fills its pane", () => {
|
|
95
|
-
const html = renderToString(
|
|
96
|
-
createElement(ComposeFormShell, {
|
|
97
|
-
layout: "fill",
|
|
98
|
-
header: createElement("div", null, "H"),
|
|
99
|
-
actionBar: createElement("div", null, "B"),
|
|
100
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
101
|
-
children: createElement("div", null, "BODY"),
|
|
102
|
-
}),
|
|
103
|
-
);
|
|
104
|
-
assert.doesNotMatch(html, /sticky/);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { createElement } from "react";
|
|
4
|
-
import { renderToString } from "react-dom/server";
|
|
5
|
-
import { Dialog } from "./dialog.js";
|
|
6
|
-
|
|
7
|
-
const render = (props: Partial<Parameters<typeof Dialog>[0]>) =>
|
|
8
|
-
renderToString(
|
|
9
|
-
createElement(Dialog, {
|
|
10
|
-
open: true,
|
|
11
|
-
onClose: () => {},
|
|
12
|
-
title: "Folders",
|
|
13
|
-
// biome-ignore lint/correctness/noChildrenProp: React 19 types require children in props object when using createElement
|
|
14
|
-
children: createElement("span", null, "nav content"),
|
|
15
|
-
...props,
|
|
16
|
-
}),
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
describe("Dialog backdrop", () => {
|
|
20
|
-
it("never frosts the content behind it (no blur, just a dim scrim)", () => {
|
|
21
|
-
const center = render({});
|
|
22
|
-
const left = render({ anchor: "left" });
|
|
23
|
-
assert.doesNotMatch(center, /backdrop-blur/, "center modal has no blur");
|
|
24
|
-
assert.doesNotMatch(left, /backdrop-blur/, "left drawer has no blur");
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("dims what it covers, at every anchor", () => {
|
|
28
|
-
for (const anchor of ["center", "left", "right"] as const) {
|
|
29
|
-
assert.match(
|
|
30
|
-
render(anchor === "center" ? {} : { anchor }),
|
|
31
|
-
/bg-canvas\/80/,
|
|
32
|
-
`${anchor} dialog dims the content behind it`,
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("right slide-over mirrors left, pinned to the other edge", () => {
|
|
38
|
-
const right = render({ anchor: "right" });
|
|
39
|
-
assert.doesNotMatch(right, /backdrop-blur/, "right drawer has no blur");
|
|
40
|
-
assert.match(right, /justify-end/, "panel is pinned to the right edge");
|
|
41
|
-
assert.match(right, /border-l/, "right drawer has a left hairline");
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("renders nothing when closed, so it never covers the content", () => {
|
|
45
|
-
assert.equal(
|
|
46
|
-
render({ open: false }),
|
|
47
|
-
"",
|
|
48
|
-
"closed dialog renders no markup",
|
|
49
|
-
);
|
|
50
|
-
});
|
|
51
|
-
});
|