test(config): mock active console org

kit/console-org-switcher
Kit Langton 2026-04-03 22:20:53 -04:00
parent 8675f51751
commit f5b30cdf39
1 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@ import { Npm } from "../../src/npm"
const emptyAccount = Layer.mock(Account.Service)({
active: () => Effect.succeed(Option.none()),
activeOrg: () => Effect.succeed(Option.none()),
})
const emptyAuth = Layer.mock(Auth.Service)({
@ -282,6 +283,21 @@ test("resolves env templates in account config with account token", async () =>
active_org_id: OrgID.make("org-1"),
}),
),
activeOrg: () =>
Effect.succeed(
Option.some({
account: {
id: AccountID.make("account-1"),
email: "user@example.com",
url: "https://control.example.com",
active_org_id: OrgID.make("org-1"),
},
org: {
id: OrgID.make("org-1"),
name: "Example Org",
},
}),
),
config: () =>
Effect.succeed(
Option.some({