Add scaffold
This commit is contained in:
parent
17e87ed054
commit
69873152b6
|
@ -0,0 +1,19 @@
|
|||
import { Response } from "node-fetch"
|
||||
import { Table } from "@budibase/types"
|
||||
import InternalAPIClient from "./InternalAPIClient"
|
||||
import { responseMessage } from "../fixtures/types/responseMessage"
|
||||
|
||||
export default class AccountsApi {
|
||||
api: InternalAPIClient
|
||||
|
||||
constructor(apiClient: InternalAPIClient) {
|
||||
this.api = apiClient
|
||||
}
|
||||
|
||||
async validateEmail(email: string): Promise<[Response, any]> {
|
||||
const response = await this.api.post(`/accounts/validate/email`, { body: { email } })
|
||||
const json = await response.json()
|
||||
expect(response).toHaveStatusCode(200)
|
||||
return [response, json]
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@ import TablesApi from "./tables"
|
|||
import RowApi from "./rows"
|
||||
import ScreenApi from "./screens"
|
||||
import UserManagementApi from "./userManagement"
|
||||
|
||||
import AccountsApi from "./accounts"
|
||||
export default class TestConfiguration<T> {
|
||||
applications: ApplicationApi
|
||||
auth: AuthApi
|
||||
|
@ -14,6 +14,7 @@ export default class TestConfiguration<T> {
|
|||
tables: TablesApi
|
||||
rows: RowApi
|
||||
users: UserManagementApi
|
||||
accounts: AccountsApi
|
||||
|
||||
constructor(apiClient: InternalAPIClient) {
|
||||
this.applications = new ApplicationApi(apiClient)
|
||||
|
@ -22,6 +23,7 @@ export default class TestConfiguration<T> {
|
|||
this.auth = new AuthApi(apiClient)
|
||||
this.screen = new ScreenApi(apiClient)
|
||||
this.users = new UserManagementApi(apiClient)
|
||||
this.accounts = new AccountsApi(apiClient)
|
||||
this.context = <T>{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue