Extend test create api
This commit is contained in:
parent
887ebb2eeb
commit
14303c9eb0
|
@ -1,4 +1,4 @@
|
||||||
import { Table } from "@budibase/types"
|
import { SaveTableRequest, SaveTableResponse, Table } from "@budibase/types"
|
||||||
import TestConfiguration from "../TestConfiguration"
|
import TestConfiguration from "../TestConfiguration"
|
||||||
import { TestAPI } from "./base"
|
import { TestAPI } from "./base"
|
||||||
|
|
||||||
|
@ -7,6 +7,19 @@ export class TableAPI extends TestAPI {
|
||||||
super(config)
|
super(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create = async (
|
||||||
|
data: SaveTableRequest,
|
||||||
|
{ expectStatus } = { expectStatus: 200 }
|
||||||
|
): Promise<SaveTableResponse> => {
|
||||||
|
const res = await this.request
|
||||||
|
.post(`/api/tables`)
|
||||||
|
.send(data)
|
||||||
|
.set(this.config.defaultHeaders())
|
||||||
|
.expect("Content-Type", /json/)
|
||||||
|
.expect(expectStatus)
|
||||||
|
return res.body
|
||||||
|
}
|
||||||
|
|
||||||
fetch = async (
|
fetch = async (
|
||||||
{ expectStatus } = { expectStatus: 200 }
|
{ expectStatus } = { expectStatus: 200 }
|
||||||
): Promise<Table[]> => {
|
): Promise<Table[]> => {
|
||||||
|
|
Loading…
Reference in New Issue