Update tests

This commit is contained in:
Andrew Kingston 2024-09-18 11:55:40 +01:00
parent 4325805ce3
commit c8c4248b3c
No known key found for this signature in database
1 changed files with 2 additions and 45 deletions

View File

@ -796,7 +796,7 @@ describe.each([
) )
}) })
it("cannot update views with readonly on on free license", async () => { it("can views with readonly on on free license", async () => {
view = await config.api.viewV2.update({ view = await config.api.viewV2.update({
...view, ...view,
schema: { schema: {
@ -810,53 +810,10 @@ describe.each([
mocks.licenses.useCloudFree() mocks.licenses.useCloudFree()
await config.api.viewV2.update(view, { await config.api.viewV2.update(view, {
status: 400, status: 200,
body: {
message: "Readonly fields are not enabled",
},
}) })
}) })
it("can remove readonly config after license downgrade", async () => {
view = await config.api.viewV2.update({
...view,
schema: {
id: { visible: true },
Price: {
visible: true,
readonly: true,
},
Category: {
visible: true,
readonly: true,
},
},
})
mocks.licenses.useCloudFree()
const res = await config.api.viewV2.update({
...view,
schema: {
id: { visible: true },
Price: {
visible: true,
readonly: false,
},
},
})
expect(res).toEqual(
expect.objectContaining({
...view,
schema: {
id: { visible: true },
Price: {
visible: true,
readonly: false,
},
},
})
)
})
isInternal && isInternal &&
it("updating schema will only validate modified field", async () => { it("updating schema will only validate modified field", async () => {
let view = await config.api.viewV2.create({ let view = await config.api.viewV2.create({