refactor(core): simplify integration credentials (#31968)
This commit is contained in:
parent
a9c810cbbc
commit
30aec297d8
112 changed files with 2467 additions and 47728 deletions
|
|
@ -92,11 +92,11 @@ test("refreshes resources into reactive getters", async () => {
|
|||
}
|
||||
})
|
||||
|
||||
test("refreshes connectors after connector updates", async () => {
|
||||
test("refreshes integrations after integration updates", async () => {
|
||||
const events = createEventSource()
|
||||
let requests = 0
|
||||
const calls = createFetch((url) => {
|
||||
if (url.pathname !== "/api/connector") return
|
||||
if (url.pathname !== "/api/integration") return
|
||||
requests++
|
||||
return json({
|
||||
location: { directory, project: { id: "proj_test", directory } },
|
||||
|
|
@ -107,7 +107,7 @@ test("refreshes connectors after connector updates", async () => {
|
|||
{
|
||||
id: "openai",
|
||||
name: "OpenAI",
|
||||
methods: [{ id: "api-key", type: "key", label: "API Key" }],
|
||||
methods: [{ type: "key" }],
|
||||
},
|
||||
],
|
||||
})
|
||||
|
|
@ -138,12 +138,12 @@ test("refreshes connectors after connector updates", async () => {
|
|||
|
||||
try {
|
||||
await mounted
|
||||
await wait(() => data.location.connector.list() !== undefined)
|
||||
expect(data.location.connector.list()).toEqual([])
|
||||
await wait(() => data.location.integration.list() !== undefined)
|
||||
expect(data.location.integration.list()).toEqual([])
|
||||
|
||||
emitEvent(events, { id: "evt_connector", type: "connector.updated", properties: {} })
|
||||
await wait(() => data.location.connector.list()?.length === 1)
|
||||
expect(data.location.connector.list()?.[0]).toMatchObject({ id: "openai", name: "OpenAI" })
|
||||
emitEvent(events, { id: "evt_integration", type: "integration.updated", properties: {} })
|
||||
await wait(() => data.location.integration.list()?.length === 1)
|
||||
expect(data.location.integration.list()?.[0]).toMatchObject({ id: "openai", name: "OpenAI" })
|
||||
} finally {
|
||||
app.renderer.destroy()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue