mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-18 06:23:31 +00:00
test(tui): update bootstrap fixtures
This commit is contained in:
parent
a6acc2397d
commit
d9742d5ede
2 changed files with 9 additions and 4 deletions
|
|
@ -161,7 +161,7 @@ test("pages older messages through nested message state", async () => {
|
|||
|
||||
try {
|
||||
await data.session.message.refresh(sessionID)
|
||||
expect(pages).toEqual([{ limit: "50", order: "desc", cursor: null }])
|
||||
expect(pages).toEqual([{ limit: "25", order: "desc", cursor: null }])
|
||||
expect(data.session.message.ids(sessionID)).toEqual(first.toReversed().map((message) => message.id))
|
||||
expect(data.session.message.cursor(sessionID)).toBe("cursor-older")
|
||||
expect(data.session.message.complete(sessionID)).toBe(false)
|
||||
|
|
@ -169,8 +169,8 @@ test("pages older messages through nested message state", async () => {
|
|||
|
||||
await data.session.message.more(sessionID)
|
||||
expect(pages).toEqual([
|
||||
{ limit: "50", order: "desc", cursor: null },
|
||||
{ limit: "50", order: null, cursor: "cursor-older" },
|
||||
{ limit: "25", order: "desc", cursor: null },
|
||||
{ limit: "25", order: null, cursor: "cursor-older" },
|
||||
])
|
||||
expect(data.session.message.ids(sessionID)[0]).toBe("msg_1")
|
||||
expect(data.session.message.ids(sessionID)).toHaveLength(51)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,8 @@ export type FetchHandler = (url: URL) => Response | Promise<Response> | undefine
|
|||
export function createFetch(override?: FetchHandler, events?: ReturnType<typeof createEventStream>) {
|
||||
const session = [] as URL[]
|
||||
const fetch = (async (input: RequestInfo | URL) => {
|
||||
const url = new URL(input instanceof Request ? input.url : String(input))
|
||||
const request = input instanceof Request ? input : new Request(input)
|
||||
const url = new URL(request.url)
|
||||
if (url.pathname === "/session") session.push(url)
|
||||
const overridden = await override?.(url)
|
||||
if (overridden) return overridden
|
||||
|
|
@ -117,6 +118,10 @@ export function createFetch(override?: FetchHandler, events?: ReturnType<typeof
|
|||
})
|
||||
if (url.pathname === "/api/reference")
|
||||
return json({ location: { directory, project: { id: "proj_test", directory } }, data: [] })
|
||||
if (url.pathname === "/api/search/provider") {
|
||||
if (request.method === "POST") return new Response(null, { status: 204 })
|
||||
return json({ location: { directory, project: { id: "proj_test", directory } }, data: null })
|
||||
}
|
||||
if (url.pathname === "/provider") return json({ all: [], default: {}, connected: [] })
|
||||
if (url.pathname === "/session") return json([])
|
||||
if (url.pathname === "/vcs") return json({ branch: "main" })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue