env.test.tsx
This file
Path
apps/web/test/env.test.tsx
450 lines · 14.1 KiB · TypeScript
Last changed by
Merge redesign into mainoscabrielbefore adoptioncaedd21
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–5why, one step back1import { describe, expect, it } from "@effect/vitest";2import { Brand } from "@repo/brand";3import { EnvSchemaView } from "@repo/protocol/domain/env";4import type { EnvItem } from "@repo/protocol/domain/env";5import { ProjectListing } from "@repo/protocol/domain/front-page";Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 6–8why, one step back6import { Ledger } from "@repo/protocol/domain/visibility";7import { isRedirect } from "@tanstack/react-router";8import { DateTime, Effect, Option, Schema } from "effect";Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 9–10why, one step back910import { ProjectView } from "../src/features/project/project-page.tsx";Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 11–18why, one step back11import {12 movedToEnvironment,13 movedToLedger,14} from "../src/features/visibility/moved.ts";15import { VisibilityView } from "../src/features/visibility/visibility-page.tsx";16import { Route as EnvRoute } from "../src/routes/$owner/$project/env.tsx";17import { Route as LedgerRoute } from "../src/routes/$owner/$project/ledger.tsx";18import { canonicalAddress } from "../src/server/addresses.ts";Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 19–20why, one step back19import { inOrder, markupOf, plainText, textOf } from "./ask-fixtures.ts";20import { textIn } from "./markup.ts";Merge redesign into mainoscabrielbefore adoptioncaedd21
line 21why, one step back21import { elementWith, mainOf } from "./records.ts";Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 22why, one step back22import { renderAt } from "./render.tsx";Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 23–75why, one step back2324const now = DateTime.makeUnsafe("2026-10-12T12:00:00Z");2526const decodeView = Schema.decodeSync(EnvSchemaView);2728const items: readonly (typeof EnvItem.Encoded)[] = [29 {30 key: "APP_ENV",31 required: true,32 sensitive: false,33 tags: [],34 type: "enum(development, test, production)",35 },36 {37 description: "Error reporting DSN. Public: it ships in builds.",38 key: "SENTRY_DSN",39 required: true,40 sensitive: false,41 tags: [],42 type: "url",43 },44 {45 description:46 "Source-map upload token. Release step only; never enters a check.",47 key: "SENTRY_AUTH_TOKEN",48 placeholder: "placeholder-sentry-auth-token",49 proxy: { domains: ["sentry.io"], path: "/api/**" },50 required: "depends",51 sensitive: true,52 tags: ["release"],53 value: { setAt: "2026-10-10T09:30:00.000Z", setBy: "ines-v" },54 },55 {56 description: "Where locale data lives.",57 key: "DATEKIT_LOCALE_DIR",58 required: true,59 sensitive: false,60 tags: [],61 },62];6364const datekit = decodeView({65 at: "9b1c3e5d7f9a1b3c5d7e9f1a3b5c7d9e1f3a5b7c",66 currentEnvKey: "APP_ENV",67 file: ".env.schema",68 imports: [],69 items,70 project: "datekit",71});7273/** A docs entry that is a script, not an address; joined at run time, as lint refuses it written out. */74const scriptAddress = ["javascript", "alert(1)"].join(":");75Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 76–82why, one step back76const ledger = Schema.decodeSync(Ledger)({77 entries: [],78 layers: [],79 posture: "open",80 postureLabel: "Open",81 project: "datekit",82});Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 83why, one step back83Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 84–93why, one step back84/** The Visibility tab as an environment test reads it, beside a ledger with nothing held back. */85const tabWith = (schema?: EnvSchemaView, at: DateTime.Utc = now) => (86 <VisibilityView env={schema} ledger={ledger} now={at} />87);8889const page = tabWith(datekit);9091const environmentOf = (markup: string) =>92 elementWith(markup, 'aria-labelledby="environment"');93Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 94–102why, one step back94const itemOf = (markup: string, key: string) => {95 const start = markup.indexOf(`data-env-key="${key}"`);96 const next = markup.indexOf("data-env-key=", start + 1);9798 return start === -199 ? ""100 : markup.slice(start, next === -1 ? undefined : next);101};102Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 103–107why, one step back103const keysOf = (markup: string) =>104 [...mainOf(markup).matchAll(/data-env-key="(?<key>[^"]*)"/gu)].map(105 (found) => found.groups?.key106 );107Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 108–109why, one step back108describe("a project's environment", () => {109 it("is titled Environment, and its status line counts the items and says who set the sensitive one", () => {Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 110why, one step back110 const markup = markupOf(page);Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 111why, one step back111Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 112–114why, one step back112 expect(environmentOf(markup)).toMatch(113 /<h2\b[^>]*id="environment"[^>]*>Environment<\/h2>/u114 );Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 115–132why, one step back115 expect(textIn(elementWith(markup, "data-env-status")).trim()).toBe(116 "4 items · 1 sensitive, set by ines-v 2 d ago"117 );118 });119120 it("lists the sensitive item first, whatever its place in the schema, then the rest in the schema's order", () => {121 expect(keysOf(markupOf(page))).toStrictEqual([122 "SENTRY_AUTH_TOKEN",123 "APP_ENV",124 "SENTRY_DSN",125 "DATEKIT_LOCALE_DIR",126 ]);127 });128129 it("says on the sensitive item's own line that it is sensitive and who set it, then its facts", () => {130 const item = itemOf(mainOf(markupOf(page)), "SENTRY_AUTH_TOKEN");131 const line = elementWith(item, "data-env-line");132Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 133–134why, one step back133 expect(item).toContain('data-sensitive="true"');134 expect(Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 135why, one step back135 inOrder(plainText(line), [Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 136why, one step back136 "SENTRY_AUTH_TOKEN",Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 137–144why, one step back137 "sensitive",138 "set by ines-v",139 "2 d ago",140 ])141 ).toBeTruthy();142 expect(elementWith(line, "data-env-sensitive")).toMatch(/text-sealed/u);143 expect(144 inOrder(plainText(item), [Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 145–149why, one step back145 "Source-map upload token.",146 "Required",147 "depends on environment",148 "Proxy",149 "sentry.io",Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 150–153why, one step back150 "only",151 "/api/**",152 "Tags",153 "release",Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 154–157why, one step back154 ])155 ).toBeTruthy();156 });157Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 158–168why, one step back158 it("says each item's sensitivity once: the lock on a sensitive item's line, a plain no on any other", () => {159 const main = mainOf(markupOf(page));160 const sensitive = plainText(itemOf(main, "SENTRY_AUTH_TOKEN"));161162 // Past its data-sensitive attribute, the word is said once in the row.163 expect(sensitive.match(/(?<!-)\bsensitive\b/giu)).toHaveLength(1);164 expect(plainText(itemOf(main, "APP_ENV"))).toContain(165 "Sensitive No. The platform holds no value for it."166 );167 });168Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 169–171why, one step back169 it("never says a value was set in the future, though it was set after the page was read", () => {170 // Served at 09:00; ines-v set the value at 09:30 while the page stayed open.171 const item = itemOf(Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 172why, one step back172 mainOf(Merge redesign into mainoscabrielbefore adoptioncaedd21
line 173why, one step back173 markupOf(tabWith(datekit, DateTime.makeUnsafe("2026-10-10T09:00:00Z")))Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 174–182why, one step back174 ),175 "SENTRY_AUTH_TOKEN"176 );177178 expect(item).toMatch(/<time\b[^>]*>now<\/time>/u);179 expect(item).not.toMatch(/>in \d+ (?:min|h|d)</u);180 });181182 it("shows every item's name, type and description", () => {Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 183why, one step back183 const text = plainText(mainOf(markupOf(page)));Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 184–197why, one step back184185 expect(186 inOrder(text, [187 "APP_ENV",188 "enum(development, test, production)",189 "SENTRY_DSN",190 "Error reporting DSN.",191 "url",192 "DATEKIT_LOCALE_DIR",193 "Where locale data lives.",194 ])195 ).toBeTruthy();196 });197Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 198–199why, one step back198 it("credits the format to varlock, linked, and says no value is shown", () => {199 const region = environmentOf(markupOf(page));Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 200why, one step back200Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 201–208why, one step back201 expect(202 inOrder(plainText(region), [203 "Declared in",204 "varlock's .env.schema format",205 "Values are never shown.",206 ])207 ).toBeTruthy();208 expect(region).toMatch(/<a\b[^>]*href="https:\/\/varlock\.dev"/u);Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 209–210why, one step back209 });210Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 211why, one step back211 it("says where it was read: the file, the landed commit and the environment", () => {Merge redesign into mainoscabrielbefore adoptioncaedd21
line 212why, one step back212 const facts = environmentOf(markupOf(page));Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 213–222why, one step back213214 expect(215 inOrder(plainText(facts), [216 "Where it was read",217 ".env.schema",218 "9b1c3e5",219 "APP_ENV",220 ])221 ).toBeTruthy();222 expect(facts).toContain(Merge build/1400-w14-foundation into mainoscabrielbefore adoption47dd2f8
line 223why, one step back223 'href="/oscabriel/datekit/commit/9b1c3e5d7f9a1b3c5d7e9f1a3b5c7d9e1f3a5b7c"'Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 224–227why, one step back224 );225 });226227 it("shows no value and no control to set or read one, only the CLI line, numbered", () => {Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 228–236why, one step back228 const markup = markupOf(page);229230 for (const control of ["<input", "<textarea", "<form", "<select"]) {231 expect(markup).not.toContain(control);232 }233234 expect(markup).not.toMatch(/reveal|show value/iu);235 // The placeholder unlanded code sees is not a value, but reads like one.236 expect(markup).not.toContain("placeholder-sentry-auth-token");Merge redesign into mainoscabrielbefore adoptioncaedd21
line 237why, one step back237 expect(plainText(environmentOf(markup))).toContain(Merge build/1400-w14-foundation into mainoscabrielbefore adoption47dd2f8
line 238why, one step back238 `${Brand.cli} env set <KEY> --project oscabriel/datekit --yes`Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 239–241why, one step back239 );240 });241Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 242–248why, one step back242 it("shows the posture the project's own ledger gives in its status line", () => {243 const layered = markupOf(244 <VisibilityView245 env={datekit}246 ledger={{ ...ledger, posture: "openCore", postureLabel: "Open core" }}247 now={now}248 />Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 249–250why, one step back249 );250Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 251–252why, one step back251 expect(elementWith(layered, "data-ledger-head")).toContain(252 'data-posture="openCore"'Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 253why, one step back253 );Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 254–256why, one step back254 expect(elementWith(markupOf(page), "data-ledger-head")).toContain(255 'data-posture="open"'256 );Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 257–258why, one step back257 });258Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 259–264why, one step back259 it("says a sensitive item nobody set is not set", () => {260 const unset = decodeView({261 ...Schema.encodeSync(EnvSchemaView)(datekit),262 items: items.map(({ value: _value, ...item }) => item),263 });264Merge redesign into mainoscabrielbefore adoptioncaedd21
line 265why, one step back265 const markup = markupOf(tabWith(unset));Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 266why, one step back266 const item = itemOf(mainOf(markup), "SENTRY_AUTH_TOKEN");Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 267–269why, one step back267268 expect(item).toContain("not set");269 expect(item).not.toContain("set by");Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 270–272why, one step back270 expect(textIn(elementWith(markup, "data-env-status")).trim()).toBe(271 "4 items · 1 sensitive, not set"272 );Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 273–296why, one step back273 });274275 it("links an item's docs only when they are a web address, and marks it deprecated", () => {276 const view = decodeView({277 ...Schema.encodeSync(EnvSchemaView)(datekit),278 items: [279 {280 deprecated: true,281 docs: "https://docs.example.invalid/locales",282 key: "OLD_LOCALE_DIR",283 required: false,284 sensitive: false,285 tags: [],286 },287 {288 docs: scriptAddress,289 key: "ODD_DOCS",290 required: false,291 sensitive: false,292 tags: [],293 },294 ],295 });296Merge redesign into mainoscabrielbefore adoptioncaedd21
line 297why, one step back297 const markup = mainOf(markupOf(tabWith(view)));Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 298–312why, one step back298299 expect(itemOf(markup, "OLD_LOCALE_DIR")).toContain(300 'href="https://docs.example.invalid/locales"'301 );302 expect(itemOf(markup, "OLD_LOCALE_DIR")).toContain("Deprecated");303 expect(markup).not.toContain(`href="${scriptAddress}`);304 expect(itemOf(markup, "ODD_DOCS")).toContain(scriptAddress);305 });306307 it("says plainly when the landed schema declares no items", () => {308 const empty = decodeView({309 ...Schema.encodeSync(EnvSchemaView)(datekit),310 items: [],311 });312Merge redesign into mainoscabrielbefore adoptioncaedd21
line 313why, one step back313 expect(textOf(tabWith(empty))).toContain("No env items");Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 314why, one step back314 });Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 315why, one step back315Merge redesign into mainoscabrielbefore adoptioncaedd21
line 316why, one step back316 it.effect("sits under the project's crumbs: datekit, then Visibility", () =>Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
line 317why, one step back317 Effect.gen(function* () {Merge redesign into mainoscabrielbefore adoptioncaedd21
line 318why, one step back318 const markup = yield* renderAt("/oscabriel/datekit/visibility", page);Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 319–320why, one step back319 const crumbs = elementWith(markup, 'aria-label="Breadcrumb"');320Merge build/1400-w14-foundation into mainoscabrielbefore adoption47dd2f8
lines 321–323why, one step back321 expect(crumbs).toMatch(322 /<a\b[^>]*href="\/oscabriel\/datekit"[^>]*>oscabriel\/datekit<\/a>/u323 );Merge redesign into mainoscabrielbefore adoptioncaedd21
line 324why, one step back324 expect(plainText(crumbs)).toContain("Visibility");Merge build/1222-project-recordsoscabrielbefore adoption2e6b5a5
lines 325–326why, one step back325 })326 );Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 327–329why, one step back327});328329describe("a project with nothing landed", () => {Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 330–332why, one step back330 it("says it has no environment yet, rather than that it is unknown, with the command to read it", () => {331 const view = tabWith();332 const text = plainText(environmentOf(markupOf(view)));Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 333why, one step back333Merge redesign into mainoscabrielbefore adoptioncaedd21
line 334why, one step back334 expect(markupOf(view)).toMatch(/<h1\b[^>]*>Visibility<\/h1>/u);Merge build/1400-w14-foundation into mainoscabrielbefore adoption47dd2f8
lines 335–338why, one step back335 expect(text).toContain("Nothing has landed in oscabriel/datekit yet");336 expect(text).toContain(337 `${Brand.cli} env shape --project oscabriel/datekit`338 );Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 339–342why, one step back339 expect(text).not.toContain("UnknownProject");340 });341});342Merge redesign into mainoscabrielbefore adoptioncaedd21
line 343why, one step back343describe("the environment's way in", () => {Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 344–362why, one step back344 it("is linked from the project's page", () => {345 const listing = Schema.decodeSync(ProjectListing)({346 landedAt: "2026-10-11T09:00:00.000Z",347 openAsks: 0,348 posture: "open",349 project: "datekit",350 });351352 const markup = markupOf(353 <ProjectView354 asks={[]}355 landings={[]}356 listing={listing}357 now={now}358 platformUrl="https://platform-test.example.workers.dev"359 />360 );361362 expect(markup).toMatch(Merge redesign into mainoscabrielbefore adoptioncaedd21
line 363why, one step back363 /<a\b[^>]*href="\/oscabriel\/datekit\/visibility#environment"[^>]*>Environment<\/a>/uMerge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 364–367why, one step back364 );365 });366});367Merge redesign into mainoscabrielbefore adoptioncaedd21
line 368why, one step back368const WEB_URL = "https://web-test.example.workers.dev";Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 369why, one step back369Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 370–374why, one step back370const movedTo = (path: string) =>371 Option.map(canonicalAddress(new Request(`${WEB_URL}${path}`)), (response) => [372 response.status,373 response.headers.get("location"),374 ]);Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 375why, one step back375Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 376–379why, one step back376const sentOnFrom = (377 moved: typeof movedToEnvironment,378 project: string,379 searchStr = ""Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 380why, one step back380) =>Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 381–387why, one step back381 Effect.tryPromise({382 catch: (thrown) =>383 isRedirect(thrown)384 ? [thrown.status, thrown.headers.get("location")]385 : ["not a redirect"],386 try: () => moved({ location: { searchStr }, params: { project } }),387 }).pipe(Effect.flip);Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 388why, one step back388Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 389–397why, one step back389describe("the old Env shape and Ledger addresses", () => {390 it("are a 301 to the Visibility tab, at its Environment and its Ledger, the query kept", () => {391 expect(movedTo("/oscabriel/datekit/env")).toStrictEqual(392 Option.some([301, "/oscabriel/datekit/visibility#environment"])393 );394 expect(movedTo("/oscabriel/datekit/ledger?x=1")).toStrictEqual(395 Option.some([301, "/oscabriel/datekit/visibility?x=1#ledger"])396 );397 });Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 398why, one step back398Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 399–406why, one step back399 it("take an old or miscased name to the tab in one move", () => {400 expect(movedTo("/datekit/env")).toStrictEqual(401 Option.some([301, "/oscabriel/datekit/visibility#environment"])402 );403 expect(movedTo("/GitHub.com/Pallets/click/ledger")).toStrictEqual(404 Option.some([301, "/github.com/pallets/click/visibility#ledger"])405 );406 });Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 407why, one step back407Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 408–415why, one step back408 it("move only the page itself, never a path below it", () => {409 expect(movedTo("/oscabriel/datekit/env/extra")).toStrictEqual(410 Option.none()411 );412 expect(movedTo("/oscabriel/datekit/visibility")).toStrictEqual(413 Option.none()414 );415 });Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 416why, one step back416Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 417–418why, one step back417 // The worker answers a document load with its 301; a page kept before the move may still link here.418 it.effect("send a navigation inside the app on to the tab", () =>Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 419why, one step back419 Effect.gen(function* () {Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 420–427why, one step back420 expect(EnvRoute.options.beforeLoad).toBe(movedToEnvironment);421 expect(LedgerRoute.options.beforeLoad).toBe(movedToLedger);422 expect(423 yield* sentOnFrom(movedToEnvironment, "oscabriel/datekit")424 ).toStrictEqual([301, "/oscabriel/datekit/visibility#environment"]);425 expect(426 yield* sentOnFrom(movedToLedger, "github.com/pallets/click", "?x=1")427 ).toStrictEqual([301, "/github.com/pallets/click/visibility?x=1#ledger"]);Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 428–429why, one step back428 })429 );Merge redesign into mainoscabrielbefore adoptioncaedd21
line 430why, one step back430});Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 431why, one step back431Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 432–439why, one step back432const webSources: Readonly<Record<string, string>> = import.meta.glob(433 [434 "../src/**/*.{ts,tsx}",435 "!../src/**/*.gen.ts",436 "../../../packages/agent-kit/src/**/*.ts",437 ],438 { eager: true, import: "default", query: "?raw" }439);Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 440why, one step back440Merge redesign into mainoscabrielbefore adoptioncaedd21
lines 441–449why, one step back441describe("the Env shape label", () => {442 it("appears nowhere the web draws from: the page is Environment now", () => {443 expect(Object.keys(webSources).length).toBeGreaterThan(100);444 expect(445 Object.entries(webSources).flatMap(([path, source]) =>446 /Env shape/u.test(source) ? [path] : []447 )448 ).toStrictEqual([]);449 });Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
line 450why, one step back450});