test(form): update link field fixtures

This commit is contained in:
Aiden Cline 2026-07-09 13:34:01 -05:00
parent 4f8fa72e45
commit 0b650e5045
2 changed files with 8 additions and 3 deletions

View file

@ -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 {

View file

@ -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")