diff --git a/.changeset/39305-setup-paths-runtime-text.md b/.changeset/39305-setup-paths-runtime-text.md new file mode 100644 index 00000000000..4203031452f --- /dev/null +++ b/.changeset/39305-setup-paths-runtime-text.md @@ -0,0 +1,27 @@ +--- +'@objectstack/spec': patch +'@objectstack/formula': patch +'@objectstack/objectql': patch +'@objectstack/platform-objects': patch +'@objectstack/plugin-auth': patch +'@objectstack/organizations': patch +'@objectstack/lint': patch +'@objectstack/cli': patch +'@objectstack/driver-odata': patch +--- + +fix: runtime messages and help text name the Setup path Setup shows + +Clause-②: no +Metadata-protocol: none + +Who sees it: an author reading a refusal or a lint finding, and an administrator reading a boot banner, a sign-in error or a field's help text. Setup was regrouped, and these messages still sent the reader to paths that no longer exist. Each now names the group and entry Setup shows: + +- **File storage** (`@objectstack/spec` stack-key guidance for a top-level `storage` key, the `os serve` local-driver warning): Setup → Audit & Data → File Storage, was Setup → Settings → Storage. +- **SMS provider** (`@objectstack/spec` `sms` description, the phone-code refusal in `@objectstack/plugin-auth`): Setup → Notifications → SMS Channel, was Setup → Settings → SMS Delivery. +- **Default currency** (`@objectstack/formula` template refusal, `@objectstack/objectql` validation-message warning): Setup → Company Settings → Language & Region, was Setup → Localization. +- **API key lifetime** (help text on the API key and user expiry fields in `@objectstack/platform-objects`): Setup → Login & Security → Sign-in Methods → API keys, was Setup → Authentication → API keys. +- **Membership policy** (the `@objectstack/organizations` boot refusal): Setup → Login & Security → Sign-in Methods → Membership, was Setup → Authentication → Membership. +- **Connector credentials** (the `@objectstack/lint` stdio-credential finding, the `@objectstack/driver-odata` README): Setup → Integrations & Developer → Connector Credentials, was Setup → Connector credentials. + +Only message text changes; no accepted value, code or status moves. diff --git a/content/docs/deployment/validating-metadata.mdx b/content/docs/deployment/validating-metadata.mdx index f279ec111e5..031f45f766f 100644 --- a/content/docs/deployment/validating-metadata.mdx +++ b/content/docs/deployment/validating-metadata.mdx @@ -392,7 +392,7 @@ export default defineStack({ stack.storage: 'storage' is not a declared stack key, so its value is dropped at load — the file-storage backend is a deployment concern, not an application declaration. Configure it with the OS_STORAGE_* environment variables, or - per-deployment in Setup → Settings → Storage. + per-deployment in Setup → Audit & Data → File Storage. ``` This is **advisory** — the stack still loads. Strict rejection is where these diff --git a/packages/cli/src/commands/serve.ts b/packages/cli/src/commands/serve.ts index baafb793662..72b2f1ba03c 100644 --- a/packages/cli/src/commands/serve.ts +++ b/packages/cli/src/commands/serve.ts @@ -3592,8 +3592,9 @@ export default class Serve extends Command { // DefaultDatasourcePlugin connect it at boot through the shared // DatasourceConnectionService (one connect path, one failure // verdict incl. OS_ALLOW_DRIVER_CONNECT_FAILURE, retained status in - // Setup → Datasources). URL→config translation stays host-side in - // resolveStorageDefinition. The dev sqlite step-down (#2229) and + // Setup → Integrations & Developer → Datasources). URL→config + // translation stays host-side in resolveStorageDefinition. The + // dev sqlite step-down (#2229) and // the loosen-only self-heal (#2186, via config.autoMigrate) now run // inside the factory at connect. const { DefaultDatasourcePlugin } = await import('@objectstack/runtime'); @@ -5649,7 +5650,7 @@ export default class Serve extends Command { // actually work — `config.storage` was in this sentence and was // never read (framework#4167). console.warn(chalk.yellow( - ` ⚠ StorageServicePlugin using local driver (${resolved.localStorageRoot}) — switch to S3/GCS/Azure for production (set OS_STORAGE_* or configure storage in Setup → Settings).`, + ` ⚠ StorageServicePlugin using local driver (${resolved.localStorageRoot}) — switch to S3/GCS/Azure for production (set OS_STORAGE_* or configure storage in Setup → Audit & Data → File Storage).`, )); } // The default settings service seals its encrypted settings with the diff --git a/packages/drivers/driver-odata/README.md b/packages/drivers/driver-odata/README.md index 7ef4affd1ab..74901bc263f 100644 --- a/packages/drivers/driver-odata/README.md +++ b/packages/drivers/driver-odata/README.md @@ -77,8 +77,8 @@ export default defineStack({ When a connector instance already authorizes the vendor, the datasource can name it in `external.connector` instead of binding a secret of its own (ADR-0015 amendment D7): one -credential, set under Setup → Connector credentials, serves the connector's flow actions and -the datasource's records. +credential, set under Setup → Integrations & Developer → Connector Credentials, serves the +connector's flow actions and the datasource's records. ```typescript connectors: [{ diff --git a/packages/formula/src/template-currency-tenant-default.test.ts b/packages/formula/src/template-currency-tenant-default.test.ts index 238faf4d050..20c4d217896 100644 --- a/packages/formula/src/template-currency-tenant-default.test.ts +++ b/packages/formula/src/template-currency-tenant-default.test.ts @@ -117,7 +117,7 @@ describe('currencyDefaultRefusal', () => { expect(currencyDefaultRefusal('{{ x | currency }}', 'CNY')).toBeNull(); const refusal = currencyDefaultRefusal('{{ x | currency }}', undefined); expect(refusal).toContain('{{ x | currency }}'); - expect(refusal).toContain('Setup → Localization'); + expect(refusal).toContain('Setup → Company Settings → Language & Region'); expect(refusal).not.toContain('@'); }); diff --git a/packages/formula/src/template-engine.ts b/packages/formula/src/template-engine.ts index f0a1d4a45bf..12138ea51f4 100644 --- a/packages/formula/src/template-engine.ts +++ b/packages/formula/src/template-engine.ts @@ -394,7 +394,7 @@ export function currencyDefaultRefusal( `the hole ${hole} has no currency argument, so it formats in the tenant default currency (the ` + '`localization.currency` setting), and no tenant default currency reached this render: the ' + 'organization has none set, or the caller did not supply it. The amount is not formatted in any ' - + `currency. Set the default currency in Setup → Localization, or ${remedy}` + + `currency. Set the default currency in Setup → Company Settings → Language & Region, or ${remedy}` ); } diff --git a/packages/lint/src/lint-connector-credential-literals.ts b/packages/lint/src/lint-connector-credential-literals.ts index 7cae1ee67d1..ce60a3fa27b 100644 --- a/packages/lint/src/lint-connector-credential-literals.ts +++ b/packages/lint/src/lint-connector-credential-literals.ts @@ -133,7 +133,7 @@ const STDIO_AUTH_UNPLACED_ROUTE = const CREDENTIAL_ENV_ROUTE = '`transport.credentialEnv` takes the NAME of the environment variable the stdio server reads, never the ' + "credential: set the secret where `auth: { type: 'bearer', credentialRef }` resolves (an environment variable " + - 'or Setup → Connector credentials) and write the variable name here'; + 'or Setup → Integrations & Developer → Connector Credentials) and write the variable name here'; /** One judged map: where it sits under the entry, what an entry of it is called, and its route. */ interface JudgedMap { diff --git a/packages/objectql/src/validation/rule-message-render.ts b/packages/objectql/src/validation/rule-message-render.ts index 3419238338a..3ecf826902f 100644 --- a/packages/objectql/src/validation/rule-message-render.ts +++ b/packages/objectql/src/validation/rule-message-render.ts @@ -142,7 +142,8 @@ function tenantCurrencyHole(hole: string, subject: string, warn: ((message: stri warn?.( `${subject}: the hole ${hole} formats in the tenant default currency, and none reached this write (the ` + 'organization has none set, or the write carried none): the hole renders empty. Set the default currency ' - + 'in Setup → Localization (`localization.currency`), or name the currency in the hole (`currency:EUR`).', + + 'in Setup → Company Settings → Language & Region (`localization.currency`), or name the currency in the ' + + 'hole (`currency:EUR`).', ); return ''; } diff --git a/packages/platform-objects/src/apps/translations/en.objects.generated.ts b/packages/platform-objects/src/apps/translations/en.objects.generated.ts index 7c841c162a7..1bb741114fd 100644 --- a/packages/platform-objects/src/apps/translations/en.objects.generated.ts +++ b/packages/platform-objects/src/apps/translations/en.objects.generated.ts @@ -374,7 +374,7 @@ export const enObjects: NonNullable = { }, expires_at: { label: "Expires At", - helpText: "Leave empty for the default lifetime set under Setup → Authentication → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused." + helpText: "Leave empty for the default lifetime set under Setup → Login & Security → Sign-in Methods → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused." } }, resultDialog: { @@ -1378,7 +1378,7 @@ export const enObjects: NonNullable = { description: "Create a key for a script or integration. The key acts as you, with your access, in the organization you are working in now.", params: { expires_at: { - helpText: "Leave empty for the default lifetime set under Setup → Authentication → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused." + helpText: "Leave empty for the default lifetime set under Setup → Login & Security → Sign-in Methods → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused." } }, resultDialog: { diff --git a/packages/platform-objects/src/identity/sys-api-key.object.ts b/packages/platform-objects/src/identity/sys-api-key.object.ts index 3715c5ace43..7a6aca09316 100644 --- a/packages/platform-objects/src/identity/sys-api-key.object.ts +++ b/packages/platform-objects/src/identity/sys-api-key.object.ts @@ -126,7 +126,7 @@ export const SysApiKey = ObjectSchema.create({ { field: 'name', required: true }, { field: 'expires_at', - helpText: 'Leave empty for the default lifetime set under Setup → Authentication → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused.', + helpText: 'Leave empty for the default lifetime set under Setup → Login & Security → Sign-in Methods → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused.', }, ], resultDialog: { diff --git a/packages/platform-objects/src/identity/sys-user.object.ts b/packages/platform-objects/src/identity/sys-user.object.ts index 10ed4373349..6abf666a4a1 100644 --- a/packages/platform-objects/src/identity/sys-user.object.ts +++ b/packages/platform-objects/src/identity/sys-user.object.ts @@ -953,7 +953,7 @@ export const SysUser = ObjectSchema.create({ label: 'Expires At', type: 'datetime', required: false, - helpText: 'Leave empty for the default lifetime set under Setup → Authentication → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused.', + helpText: 'Leave empty for the default lifetime set under Setup → Login & Security → Sign-in Methods → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused.', }, ], resultDialog: { @@ -1095,7 +1095,7 @@ export const SysUser = ObjectSchema.create({ // These three are the ONLY 2FA surface a user can actually reach: the // `sys_two_factor` variants that carry the same declarations are mounted // in no app (`setup-nav.contributions.ts` has no `sys_two_factor` entry), - // so this record page — Setup → People & Organization → Users, Security + // so this record page — Setup → Users & Organization → Users, Security // tab, via `record:quick_actions { location: 'record_section' }` in // `pages/sys-user.page.ts` — is where these run in production. // diff --git a/packages/plugins/organizations/src/membership-policy-gate.test.ts b/packages/plugins/organizations/src/membership-policy-gate.test.ts index e3e74805666..d35e4d93813 100644 --- a/packages/plugins/organizations/src/membership-policy-gate.test.ts +++ b/packages/plugins/organizations/src/membership-policy-gate.test.ts @@ -200,7 +200,7 @@ describe('which postures the gate covers', () => { describe('what counts as a declaration', () => { it.each(['global', 'tenant', 'user'] as const)( - 'a STORED row (source: %s) is a declaration — Setup → Authentication → Membership counts', + 'a STORED row (source: %s) is a declaration — Setup → Login & Security → Sign-in Methods → Membership counts', async (source) => { posture('isolated'); // Deliberately paired with an auth manager still reporting `auto`: the @@ -373,7 +373,7 @@ describe('the refusal', () => { expect(msg).toContain(MEMBERSHIP_POLICY_SETTING); expect(msg).toContain(`${MEMBERSHIP_POLICY_ENV}=invite-only`); expect(msg).toContain(`${MEMBERSHIP_POLICY_ENV}=auto`); - expect(msg).toContain('Setup → Authentication →'); + expect(msg).toContain('Setup → Login & Security → Sign-in Methods → Membership'); expect(msg).toContain('OS_TENANCY_POSTURE=single'); }); diff --git a/packages/plugins/organizations/src/membership-policy-gate.ts b/packages/plugins/organizations/src/membership-policy-gate.ts index b7394649797..6aefac82083 100644 --- a/packages/plugins/organizations/src/membership-policy-gate.ts +++ b/packages/plugins/organizations/src/membership-policy-gate.ts @@ -322,10 +322,10 @@ export function walledMembershipPolicyFatalMessage( : [ ' Fix one of — EITHER is a declaration, and that is the entire point:', ' • invitation only, what a walled deployment almost always wants: set', - ` ${MEMBERSHIP_POLICY_ENV}=invite-only, or Setup → Authentication →`, - ' Membership → "Invitation only". Membership then comes solely from an explicit', - ' act — creating a workspace, accepting an invitation, an admin adding you, SSO', - ' just-in-time provisioning; or', + ` ${MEMBERSHIP_POLICY_ENV}=invite-only, or pick "Invitation only" under`, + ' Setup → Login & Security → Sign-in Methods → Membership. Membership then comes', + ' solely from an explicit act — creating a workspace, accepting an invitation, an', + ' admin adding you, SSO just-in-time provisioning; or', ` • knowingly accept automatic joins: set ${MEMBERSHIP_POLICY_ENV}=auto`, ' (or pick "Join the default organization automatically" in Setup). Boot then', ' proceeds with exactly the behavior above — declared this time, so it survives', diff --git a/packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts b/packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts index 4be8b1002eb..84046e93b2b 100644 --- a/packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts +++ b/packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts @@ -390,8 +390,8 @@ export async function deliverPhoneOtp(this: Pick = Object.freeze({ storage: { why: 'the file-storage backend is a deployment concern, not an application declaration. ' - + 'Configure it with the OS_STORAGE_* environment variables, or per-deployment in Setup → Settings → Storage ' + + 'Configure it with the OS_STORAGE_* environment variables, or per-deployment in Setup → Audit & Data → File Storage ' + '(which also holds credentials — a stack definition would commit them to git and to any published artifact).', }, }); diff --git a/packages/spec/src/stack.zod.ts b/packages/spec/src/stack.zod.ts index 9d0d3e1847a..b256f578750 100644 --- a/packages/spec/src/stack.zod.ts +++ b/packages/spec/src/stack.zod.ts @@ -1165,7 +1165,7 @@ const STACK_DEFINITION_COLLECTIONS_SHAPE = { sms: StackSmsConfigSchema.optional() .describe( 'SMS configuration — retries only. The provider and its credentials are not authorable here: ' - + 'Setup → Settings → SMS Delivery, or OS_SMS_PROVIDER and the other OS_SMS_* env overrides', + + 'Setup → Notifications → SMS Channel, or OS_SMS_PROVIDER and the other OS_SMS_* env overrides', ), /** @@ -2322,9 +2322,9 @@ export const ObjectStackDefinitionSchema = lazySchema(() => strictObject({ guidance: { storage: 'the file-storage backend is a deployment concern, not an application declaration. ' - + 'Configure it with the OS_STORAGE_* environment variables, or per-deployment in Setup → ' - + 'Settings → Storage (which also holds credentials — a stack definition would commit them ' - + 'to git and to any published artifact).', + + 'Configure it with the OS_STORAGE_* environment variables, or per-deployment in ' + + 'Setup → Audit & Data → File Storage (which also holds credentials — a stack definition would ' + + 'commit them to git and to any published artifact).', approvals: 'approvals are not a top-level collection (ADR-0019): author an approval as a flow with ' + 'one or more Approval nodes, in `flows`.', diff --git a/packages/spec/src/ui/setup-paths-in-runtime-text.pin.test.ts b/packages/spec/src/ui/setup-paths-in-runtime-text.pin.test.ts new file mode 100644 index 00000000000..bf74037e7c3 --- /dev/null +++ b/packages/spec/src/ui/setup-paths-in-runtime-text.pin.test.ts @@ -0,0 +1,159 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +import { describe, expect, it } from 'vitest'; + +// ─── Runtime text names the Setup path Setup shows ────────────────────────── +// +// Refusals, boot banners and help text send authors and administrators to a +// place in Setup ("Setup → Audit & Data → File Storage"). Setup was regrouped: +// groups were renamed and the settings hub left the nav, so a path written +// before the regroup sends the reader somewhere that no longer exists. +// +// This pin lists every location that names a Setup path and holds two rules +// against the LIVE Setup tree, read as text from the packages that build it: +// +// 1. Each location names the path its table row expects: the group is the +// one the entry's contributing package files it under (a retired group id +// resolved through `renamedFrom` in `setup.app.ts`), and both labels are +// the English labels of `translations/en.ts`. +// 2. Every `Setup → …` path in a location starts with a live group label, and +// its second step starts with a live entry label. A retired group name +// ("Diagnostics", "Configuration", …), the retired settings hub +// ("Settings") or a removed entry name ("Localization", "SMS Delivery", +// …) fails here. +// +// Why `packages/spec`: the locations sit in nine packages and the docs tree, +// and spec's `repo` project already reads `packages/**` and `content/**` as +// text (scripts/cross-package-test-inputs.mjs), so the pin imports nothing and +// adds no dependency edge. A path split across two string literals is not one +// path to this reader: keep each path inside one literal, on one line. + +const SPEC_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..'); +const REPO_ROOT = path.resolve(SPEC_ROOT, '../..'); +const read = (rel: string): string => fs.readFileSync(path.join(REPO_ROOT, rel), 'utf8'); + +const SETUP_APP = 'packages/platform-objects/src/apps/setup.app.ts'; +const EN_BUNDLE = 'packages/platform-objects/src/apps/translations/en.ts'; +const PLATFORM_NAV = 'packages/platform-objects/src/apps/setup-nav.contributions.ts'; +const CONNECTOR_NAV = 'packages/services/service-automation/src/connector-credentials-ui.ts'; + +/** Where each entry named below is contributed from. */ +const CONTRIBUTOR: Record = { + nav_settings_storage: PLATFORM_NAV, + nav_settings_sms: PLATFORM_NAV, + nav_settings_localization: PLATFORM_NAV, + nav_settings_auth: PLATFORM_NAV, + nav_connector_credentials: CONNECTOR_NAV, +}; + +/** Every location that names a Setup path, and the entries it must name. */ +const LOCATIONS: ReadonlyArray<{ file: string; entries: string[] }> = [ + { file: 'packages/spec/src/stack.zod.ts', entries: ['nav_settings_storage', 'nav_settings_sms'] }, + { file: 'packages/spec/src/data/authoring-key-lint.ts', entries: ['nav_settings_storage'] }, + { file: 'packages/formula/src/template-engine.ts', entries: ['nav_settings_localization'] }, + { file: 'packages/objectql/src/validation/rule-message-render.ts', entries: ['nav_settings_localization'] }, + // The API-key lifetime policy is the "API keys" section of the auth settings + // page, not the API Keys object list: the path ends "→ Sign-in Methods → API keys". + { file: 'packages/platform-objects/src/identity/sys-api-key.object.ts', entries: ['nav_settings_auth'] }, + { file: 'packages/platform-objects/src/identity/sys-user.object.ts', entries: ['nav_settings_auth'] }, + { file: 'packages/platform-objects/src/apps/translations/en.objects.generated.ts', entries: ['nav_settings_auth'] }, + { file: 'packages/plugins/plugin-auth/src/auth-manager-email-sms-delivery.ts', entries: ['nav_settings_sms'] }, + { file: 'packages/plugins/organizations/src/membership-policy-gate.ts', entries: ['nav_settings_auth'] }, + { file: 'packages/lint/src/lint-connector-credential-literals.ts', entries: ['nav_connector_credentials'] }, + { file: 'packages/cli/src/commands/serve.ts', entries: ['nav_settings_storage'] }, + { file: 'packages/drivers/driver-odata/README.md', entries: ['nav_connector_credentials'] }, + { file: 'content/docs/deployment/validating-metadata.mdx', entries: ['nav_settings_storage'] }, +]; + +/** English labels of the Setup groups and entries, keyed by id. */ +function liveLabels(): Map { + const labels = new Map(); + for (const m of read(EN_BUNDLE).matchAll(/\b((?:group|nav)_\w+): \{ label: '([^']+)'/g)) { + labels.set(m[1], m[2]); + } + return labels; +} + +/** Each group node of `setup.app.ts`: its id, the ids it took over, and its former names. */ +function setupGroups(): Array<{ id: string; renamedFrom: string[]; keywords: string[] }> { + const strings = (list: string | undefined) => [...(list ?? '').matchAll(/'([^']+)'/g)].map((m) => m[1]); + return read(SETUP_APP) + .split(/id: '(?=group_)/) + .slice(1) + .map((chunk) => ({ + id: chunk.slice(0, chunk.indexOf("'")), + renamedFrom: strings(/renamedFrom: \[([^\]]*)\]/.exec(chunk)?.[1]), + keywords: strings(/keywords: \[([^\]]*)\]/.exec(chunk)?.[1]), + })); +} + +/** The group Setup files an entry under: its contribution's `group`, through `renamedFrom`. */ +function groupOf(entry: string): string { + const source = read(CONTRIBUTOR[entry]); + const at = source.indexOf(`id: '${entry}'`); + expect(at, `${entry} must be contributed by ${CONTRIBUTOR[entry]}`).toBeGreaterThan(-1); + const declared = [...source.slice(0, at).matchAll(/group: '(\w+)'/g)].at(-1)?.[1]; + expect(declared, `${entry} must sit under a group in ${CONTRIBUTOR[entry]}`).toBeDefined(); + const group = setupGroups().find((g) => g.id === declared || g.renamedFrom.includes(declared!)); + expect(group, `${declared} must be a Setup group or a retired id one took over`).toBeDefined(); + return group!.id; +} + +/** True when `segment` begins with `label` as a whole label. */ +function startsWithLabel(segment: string, label: string): boolean { + return segment.startsWith(label) && /^(?:\s*$|\s*[^\sA-Za-z0-9&-])/.test(segment.slice(label.length)); +} + +/** Every `Setup → …` path in `text` whose group or entry step is not live. */ +function staleSetupPaths(text: string, groupLabels: string[], entryLabels: string[]): string[] { + const stale: string[] = []; + for (const m of text.matchAll(/Setup → ([^\n]*)/g)) { + const [group = '', entry] = m[1].split('→').map((s) => s.trim()); + const groupOk = groupLabels.some((l) => startsWithLabel(group, l)); + const entryOk = entry === undefined || entryLabels.some((l) => startsWithLabel(entry, l)); + if (!groupOk || !entryOk) stale.push(m[0].trim()); + } + return stale; +} + +describe('runtime text names the Setup path Setup shows', () => { + const labels = liveLabels(); + const groupLabels = [...labels].filter(([id]) => id.startsWith('group_')).map(([, l]) => l); + const entryLabels = [...labels].filter(([id]) => id.startsWith('nav_')).map(([, l]) => l); + + it.each(LOCATIONS)('$file names the live group and entry', ({ file, entries }) => { + const text = read(file); + for (const entry of entries) { + const group = groupOf(entry); + const expected = `Setup → ${labels.get(group)} → ${labels.get(entry)}`; + expect(text, `${file} must name ${expected}`).toContain(expected); + } + expect(staleSetupPaths(text, groupLabels, entryLabels), `${file} names a Setup path Setup does not show`).toEqual([]); + }); + + it('fails on every retired group name, the retired settings hub and a removed entry name', () => { + const formerGroups = setupGroups().flatMap((g) => (g.renamedFrom.length > 0 ? g.keywords : [])); + expect(formerGroups.length).toBeGreaterThan(0); + const formerEntries = [...read(PLATFORM_NAV).matchAll(/keywords: \[([^\]]*)\]/g)] + .flatMap((m) => [...m[1].matchAll(/'([^']+)'/g)].map((k) => k[1])) + .filter((name) => !entryLabels.includes(name)); + expect(formerEntries).toEqual(expect.arrayContaining(['Localization', 'SMS Delivery', 'Authentication'])); + const controls = [ + ...formerGroups.map((name) => `Setup → ${name} → Users`), + ...formerEntries.map((name) => `Setup → Company Settings → ${name}.`), + 'Setup → Settings → Storage (which', + 'Setup → Settings).', + 'Setup → Localization, or', + 'Setup → Connector credentials)', + 'Setup → Login & Security →', + ]; + for (const control of controls) { + expect(staleSetupPaths(control, groupLabels, entryLabels), control).toHaveLength(1); + } + expect(staleSetupPaths('Setup → Audit & Data → File Storage (which', groupLabels, entryLabels)).toEqual([]); + }); +}); diff --git a/packages/spec/vitest.repo-tests.json b/packages/spec/vitest.repo-tests.json index 5a38a99375a..6cc8854d403 100644 --- a/packages/spec/vitest.repo-tests.json +++ b/packages/spec/vitest.repo-tests.json @@ -87,6 +87,7 @@ "src/ui/page-header-breadcrumb-retirement.test.ts", "src/ui/page-header-show-star-retirement.test.ts", "src/ui/page-slots-tabs-retirement.test.ts", + "src/ui/setup-paths-in-runtime-text.pin.test.ts", "src/ui/view-data-api-provider-retirement.test.ts", "src/ui/view-form-slots-retirement.test.ts", "src/ui/view-item-owner-hidden-retirement.test.ts",