mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-10 01:39:36 +00:00
test(form): update link field fixtures
This commit is contained in:
parent
4f8fa72e45
commit
0b650e5045
2 changed files with 8 additions and 3 deletions
|
|
@ -10,7 +10,7 @@ function ok<T>(data: T) {
|
|||
}
|
||||
|
||||
function form(id: string, sessionID: string): FormInfo {
|
||||
return { id, sessionID, title: "Input requested", mode: "form", fields: [] }
|
||||
return { id, sessionID, title: "Input requested", fields: [] }
|
||||
}
|
||||
|
||||
function formCreated(info: FormInfo): V2Event {
|
||||
|
|
|
|||
|
|
@ -838,13 +838,18 @@ const scenarios: Scenario[] = [
|
|||
.at((ctx) => ({
|
||||
path: route("/api/session/{sessionID}/form", { sessionID: ctx.state.id }),
|
||||
headers: ctx.headers(),
|
||||
body: { mode: "url", url: "https://example.com/form" },
|
||||
body: {
|
||||
title: "External form",
|
||||
fields: [{ type: "link", url: "https://example.com/form" }],
|
||||
},
|
||||
}))
|
||||
.json(200, (body) => {
|
||||
object(body)
|
||||
object(body.data)
|
||||
check(typeof body.data.id === "string", "form create should return an ID")
|
||||
check(body.data.mode === "url", "form create should preserve URL mode")
|
||||
array(body.data.fields)
|
||||
object(body.data.fields[0])
|
||||
check(body.data.fields[0].type === "link", "form create should preserve the link field")
|
||||
}),
|
||||
http.protected
|
||||
.get("/api/session/{sessionID}/form/{formID}", "v2.session.form.get")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue