final test case.

This commit is contained in:
mike12345567 2024-10-22 15:06:50 +01:00
parent ebc440a0b6
commit fe35ef74e7
1 changed files with 19 additions and 1 deletions

View File

@ -86,7 +86,6 @@ describe("/screens", () => {
status: 200, status: 200,
} }
) )
// basic and role1 screen
expect(res.screens.length).toEqual(screenIds.length) expect(res.screens.length).toEqual(screenIds.length)
expect(res.screens.map(s => s._id).sort()).toEqual(screenIds.sort()) expect(res.screens.map(s => s._id).sort()).toEqual(screenIds.sort())
}) })
@ -107,6 +106,25 @@ describe("/screens", () => {
screen2._id!, screen2._id!,
]) ])
}) })
it("should be able to fetch basic and screen 1 with role1 in role header", async () => {
await config.withHeaders(
{
"x-budibase-role": role1._id!,
},
async () => {
const res = await config.api.application.getDefinition(
config.prodAppId!,
{
status: 200,
}
)
const screenIds = [screen._id!, screen1._id!]
expect(res.screens.length).toEqual(screenIds.length)
expect(res.screens.map(s => s._id).sort()).toEqual(screenIds.sort())
}
)
})
}) })
describe("save", () => { describe("save", () => {