1
0
Fork 0
mirror of synced 2024-06-17 01:44:53 +12:00
budibase/packages/worker/src/tests/api/configs.ts

38 lines
967 B
TypeScript
Raw Normal View History

import TestConfiguration from "../TestConfiguration"
2022-11-12 04:43:41 +13:00
import { TestAPI } from "./base"
2022-11-12 04:43:41 +13:00
export class ConfigAPI extends TestAPI {
constructor(config: TestConfiguration) {
2022-11-12 04:43:41 +13:00
super(config)
}
getConfigChecklist = () => {
return this.request
.get(`/api/global/configs/checklist`)
.set(this.config.defaultHeaders())
.expect("Content-Type", /json/)
.expect(200)
}
saveConfig = (data: any) => {
return this.request
.post(`/api/global/configs`)
.send(data)
.set(this.config.defaultHeaders())
.expect("Content-Type", /json/)
.expect(200)
}
OIDCCallback = (configId: string) => {
return this.request
.get(`/api/global/auth/${this.config.getTenantId()}/oidc/callback`)
.set(this.config.getOIDConfigCookie(configId))
}
getOIDCConfig = (configId: string) => {
return this.request.get(
`/api/global/auth/${this.config.getTenantId()}/oidc/configs/${configId}`
)
}
}