mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-18 07:12:47 +03:00
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:
@@ -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,
|
||||
})
|
||||
Reference in New Issue
Block a user