Add scaffold

This commit is contained in:
Pedro Silva 2022-12-19 15:46:38 +00:00
parent 17e87ed054
commit 69873152b6
2 changed files with 22 additions and 1 deletions

View File

@ -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]
}
}

View File

@ -5,7 +5,7 @@ import TablesApi from "./tables"
import RowApi from "./rows" import RowApi from "./rows"
import ScreenApi from "./screens" import ScreenApi from "./screens"
import UserManagementApi from "./userManagement" import UserManagementApi from "./userManagement"
import AccountsApi from "./accounts"
export default class TestConfiguration<T> { export default class TestConfiguration<T> {
applications: ApplicationApi applications: ApplicationApi
auth: AuthApi auth: AuthApi
@ -14,6 +14,7 @@ export default class TestConfiguration<T> {
tables: TablesApi tables: TablesApi
rows: RowApi rows: RowApi
users: UserManagementApi users: UserManagementApi
accounts: AccountsApi
constructor(apiClient: InternalAPIClient) { constructor(apiClient: InternalAPIClient) {
this.applications = new ApplicationApi(apiClient) this.applications = new ApplicationApi(apiClient)
@ -22,6 +23,7 @@ export default class TestConfiguration<T> {
this.auth = new AuthApi(apiClient) this.auth = new AuthApi(apiClient)
this.screen = new ScreenApi(apiClient) this.screen = new ScreenApi(apiClient)
this.users = new UserManagementApi(apiClient) this.users = new UserManagementApi(apiClient)
this.accounts = new AccountsApi(apiClient)
this.context = <T>{} this.context = <T>{}
} }