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
1 changed files with 3 additions and 13 deletions

View File

@ -1,18 +1,8 @@
import TestConfiguration from "../TestConfiguration"
import { Screen } from "@budibase/types" import { Screen } from "@budibase/types"
import { TestAPI } from "./base" import { Expectations, TestAPI } from "./base"
export class ScreenAPI extends TestAPI { export class ScreenAPI extends TestAPI {
constructor(config: TestConfiguration) { list = async (expectations?: Expectations): Promise<Screen[]> => {
super(config) return await this._get<Screen[]>(`/api/screens`, { expectations })
}
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[]
} }
} }