Migrate ScreenAPI
This commit is contained in:
parent
f91db6d985
commit
149d2c0b29
|
@ -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[]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue