Fix tests
This commit is contained in:
parent
1eb929736c
commit
422b1e2753
2 changed files with 100 additions and 85 deletions
|
@ -106,6 +106,10 @@ export const useViewPermissions = () => {
|
||||||
return useFeature(Feature.VIEW_PERMISSIONS)
|
return useFeature(Feature.VIEW_PERMISSIONS)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const useViewReadonlyColumns = () => {
|
||||||
|
return useFeature(Feature.VIEW_READONLY_COLUMNS)
|
||||||
|
}
|
||||||
|
|
||||||
// QUOTAS
|
// QUOTAS
|
||||||
|
|
||||||
export const setAutomationLogsQuota = (value: number) => {
|
export const setAutomationLogsQuota = (value: number) => {
|
||||||
|
|
|
@ -104,6 +104,10 @@ describe.each([
|
||||||
setup.afterAll()
|
setup.afterAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
mocks.licenses.useCloudFree()
|
||||||
|
})
|
||||||
|
|
||||||
const getRowUsage = async () => {
|
const getRowUsage = async () => {
|
||||||
const { total } = await config.doInContext(undefined, () =>
|
const { total } = await config.doInContext(undefined, () =>
|
||||||
quotas.getCurrentUsageValues(QuotaUsageType.STATIC, StaticQuotaName.ROWS)
|
quotas.getCurrentUsageValues(QuotaUsageType.STATIC, StaticQuotaName.ROWS)
|
||||||
|
@ -269,6 +273,10 @@ describe.each([
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("readonly fields", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
mocks.licenses.useViewReadonlyColumns()
|
||||||
|
})
|
||||||
it("readonly fields are persisted", async () => {
|
it("readonly fields are persisted", async () => {
|
||||||
const table = await config.api.table.save(
|
const table = await config.api.table.save(
|
||||||
saveTableRequest({
|
saveTableRequest({
|
||||||
|
@ -345,7 +353,8 @@ describe.each([
|
||||||
await config.api.viewV2.create(newView, {
|
await config.api.viewV2.create(newView, {
|
||||||
status: 400,
|
status: 400,
|
||||||
body: {
|
body: {
|
||||||
message: 'Field "name" cannot be readonly as it is a required field',
|
message:
|
||||||
|
'Field "name" cannot be readonly as it is a required field',
|
||||||
status: 400,
|
status: 400,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -387,6 +396,7 @@ describe.each([
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe("update", () => {
|
describe("update", () => {
|
||||||
let view: ViewV2
|
let view: ViewV2
|
||||||
|
@ -423,6 +433,7 @@ describe.each([
|
||||||
})
|
})
|
||||||
|
|
||||||
it("can update all fields", async () => {
|
it("can update all fields", async () => {
|
||||||
|
mocks.licenses.useViewReadonlyColumns()
|
||||||
const tableId = table._id!
|
const tableId = table._id!
|
||||||
|
|
||||||
const updatedData: Required<UpdateViewRequest> = {
|
const updatedData: Required<UpdateViewRequest> = {
|
||||||
|
|
Loading…
Reference in a new issue