feat(core): add pluggable web search (#35558)
Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
parent
2ddc91a0e8
commit
efb629a33a
57 changed files with 1700 additions and 587 deletions
|
|
@ -213,6 +213,8 @@ test("refreshes resources into reactive getters", async () => {
|
|||
location,
|
||||
data: [{ id: "build", request: { headers: {}, body: {} }, mode: "primary", hidden: false, permissions: [] }],
|
||||
})
|
||||
if (url.pathname === "/api/websearch/provider")
|
||||
return json({ location, data: [{ id: "standalone", name: "Standalone" }] })
|
||||
return undefined
|
||||
}, events)
|
||||
let data!: ReturnType<typeof useData>
|
||||
|
|
@ -248,6 +250,7 @@ test("refreshes resources into reactive getters", async () => {
|
|||
await data.session.sync("ses_test")
|
||||
await data.session.message.sync("ses_test")
|
||||
await data.location.agent.sync()
|
||||
await data.location.websearch.refresh()
|
||||
|
||||
expect(data.session.get("ses_test")?.title).toBe("Test session")
|
||||
expect(data.session.message.list("ses_test").map((message) => message.id)).toEqual(["msg_first", "msg_second"])
|
||||
|
|
@ -256,6 +259,7 @@ test("refreshes resources into reactive getters", async () => {
|
|||
expect(app.captureCharFrame()).toContain("msg_second")
|
||||
expect(data.location.default()).toEqual({ directory, workspaceID: undefined })
|
||||
expect(data.location.agent.list(location)?.map((agent) => agent.id)).toEqual(["build"])
|
||||
expect(data.location.websearch.list(location)).toEqual([{ id: "standalone", name: "Standalone" }])
|
||||
} finally {
|
||||
app.renderer.destroy()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue