test(cli-rs): compare acp --login with TS under a PTY

The scenario reuses C.8's sandbox registration of the fake server and C.5's
integration routes and URL sink, so no real service or account is touched.
This commit is contained in:
Simon Klee
2026-11-05 00:45:58 +01:00
Unverified
parent 8828799341
commit a90aa21263
+38
View File
@@ -0,0 +1,38 @@
// `acp --login` (AC02): runs `auth login` with no target. The command finds the registered fake service
// (C.8's sandbox registration, so no real service or account is touched), opens the integration picker,
// and connects Acme through its external method with the form answers. URL opens go to C.5's sink.
import { definePty } from "../../pty/run"
import { integrationRoutes, sink } from "../C.5/fixture"
import { down, enter, first, press } from "../C.5/keys"
import { env, info, only, register } from "../C.8/fixture"
export default definePty({
args: [],
command: only(["acp", "--login"]),
cols: 100,
rows: 40,
env: { ...env, ...sink },
setup: register,
server: {
version: false,
routes: [
info([]),
...integrationRoutes(),
{ method: "POST", path: "/api/integration/acme/connect/external", status: 204 },
],
},
steps: [
first("Select integration", "picker"),
press("acme", "filtered"),
press(enter, "region", "Region"),
press(down + enter, "team", "Team"),
press("core" + enter, "seats", "Seats"),
press("3" + enter, "beta", "Beta features"),
press(enter, "scopes", "Scopes"),
press(enter, "residency", "Data residency"),
press("yes" + enter, "done", "Done"),
],
osc: [],
exits: true,
requests: true,
})