Run test only with internal tables
This commit is contained in:
parent
7aa6af6e13
commit
47b77d6744
1 changed files with 42 additions and 41 deletions
|
@ -841,51 +841,52 @@ describe.each([
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("updating schema will only validate modified field", async () => {
|
isInternal &&
|
||||||
let view = await config.api.viewV2.create({
|
it("updating schema will only validate modified field", async () => {
|
||||||
tableId: table._id!,
|
let view = await config.api.viewV2.create({
|
||||||
name: generator.guid(),
|
tableId: table._id!,
|
||||||
schema: {
|
name: generator.guid(),
|
||||||
id: { visible: true },
|
|
||||||
Price: {
|
|
||||||
visible: true,
|
|
||||||
},
|
|
||||||
Category: { visible: true },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// Update the view to an invalid state
|
|
||||||
const tableToUpdate = await config.api.table.get(table._id!)
|
|
||||||
;(tableToUpdate.views![view.name] as ViewV2).schema!.id.visible = false
|
|
||||||
await db.getDB(config.appId!).put(tableToUpdate)
|
|
||||||
|
|
||||||
view = await config.api.viewV2.get(view.id)
|
|
||||||
await config.api.viewV2.update({
|
|
||||||
...view,
|
|
||||||
schema: {
|
|
||||||
...view.schema,
|
|
||||||
Price: {
|
|
||||||
visible: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(await config.api.viewV2.get(view.id)).toEqual(
|
|
||||||
expect.objectContaining({
|
|
||||||
schema: {
|
schema: {
|
||||||
id: expect.objectContaining({
|
id: { visible: true },
|
||||||
visible: false,
|
Price: {
|
||||||
}),
|
|
||||||
Price: expect.objectContaining({
|
|
||||||
visible: false,
|
|
||||||
}),
|
|
||||||
Category: expect.objectContaining({
|
|
||||||
visible: true,
|
visible: true,
|
||||||
}),
|
},
|
||||||
|
Category: { visible: true },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
|
||||||
})
|
// Update the view to an invalid state
|
||||||
|
const tableToUpdate = await config.api.table.get(table._id!)
|
||||||
|
;(tableToUpdate.views![view.name] as ViewV2).schema!.id.visible = false
|
||||||
|
await db.getDB(config.appId!).put(tableToUpdate)
|
||||||
|
|
||||||
|
view = await config.api.viewV2.get(view.id)
|
||||||
|
await config.api.viewV2.update({
|
||||||
|
...view,
|
||||||
|
schema: {
|
||||||
|
...view.schema,
|
||||||
|
Price: {
|
||||||
|
visible: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(await config.api.viewV2.get(view.id)).toEqual(
|
||||||
|
expect.objectContaining({
|
||||||
|
schema: {
|
||||||
|
id: expect.objectContaining({
|
||||||
|
visible: false,
|
||||||
|
}),
|
||||||
|
Price: expect.objectContaining({
|
||||||
|
visible: false,
|
||||||
|
}),
|
||||||
|
Category: expect.objectContaining({
|
||||||
|
visible: true,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("delete", () => {
|
describe("delete", () => {
|
||||||
|
|
Loading…
Reference in a new issue