1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Migrate ScreenAPI

This commit is contained in:
Sam Rose 2024-03-01 17:14:30 +00:00
parent f91db6d985
commit 149d2c0b29
No known key found for this signature in database

View file

@ -1,18 +1,8 @@
import TestConfiguration from "../TestConfiguration"
import { Screen } from "@budibase/types"
import { TestAPI } from "./base"
import { Expectations, TestAPI } from "./base"
export class ScreenAPI extends TestAPI {
constructor(config: TestConfiguration) {
super(config)
}
list = async (): Promise<Screen[]> => {
const res = await this.request
.get(`/api/screens`)
.set(this.config.defaultHeaders())
.expect("Content-Type", /json/)
.expect(200)
return res.body as Screen[]
list = async (expectations?: Expectations): Promise<Screen[]> => {
return await this._get<Screen[]>(`/api/screens`, { expectations })
}
}