Move test to right describe
This commit is contained in:
parent
9b67481661
commit
8a9e868527
|
@ -978,49 +978,6 @@ describe.each([
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("read", () => {
|
|
||||||
let view: ViewV2
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
table = await config.api.table.save(
|
|
||||||
saveTableRequest({
|
|
||||||
schema: {
|
|
||||||
Country: {
|
|
||||||
type: FieldType.STRING,
|
|
||||||
name: "Country",
|
|
||||||
},
|
|
||||||
Story: {
|
|
||||||
type: FieldType.STRING,
|
|
||||||
name: "Story",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
view = await config.api.viewV2.create({
|
|
||||||
tableId: table._id!,
|
|
||||||
name: generator.guid(),
|
|
||||||
schema: {
|
|
||||||
id: { visible: true },
|
|
||||||
Country: {
|
|
||||||
visible: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
it("views have extra data trimmed", async () => {
|
|
||||||
let row = await config.api.row.save(view.id, {
|
|
||||||
Country: "Aussy",
|
|
||||||
Story: "aaaaa",
|
|
||||||
})
|
|
||||||
|
|
||||||
row = await config.api.row.get(table._id!, row._id!)
|
|
||||||
expect(row.Story).toBeUndefined()
|
|
||||||
expect(row.Country).toEqual("Aussy")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("row operations", () => {
|
describe("row operations", () => {
|
||||||
let table: Table, view: ViewV2
|
let table: Table, view: ViewV2
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@ -1194,6 +1151,50 @@ describe.each([
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("read", () => {
|
||||||
|
let view: ViewV2
|
||||||
|
let table: Table
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
table = await config.api.table.save(
|
||||||
|
saveTableRequest({
|
||||||
|
schema: {
|
||||||
|
Country: {
|
||||||
|
type: FieldType.STRING,
|
||||||
|
name: "Country",
|
||||||
|
},
|
||||||
|
Story: {
|
||||||
|
type: FieldType.STRING,
|
||||||
|
name: "Story",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
view = await config.api.viewV2.create({
|
||||||
|
tableId: table._id!,
|
||||||
|
name: generator.guid(),
|
||||||
|
schema: {
|
||||||
|
id: { visible: true },
|
||||||
|
Country: {
|
||||||
|
visible: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it("views have extra data trimmed", async () => {
|
||||||
|
let row = await config.api.row.save(view.id, {
|
||||||
|
Country: "Aussy",
|
||||||
|
Story: "aaaaa",
|
||||||
|
})
|
||||||
|
|
||||||
|
row = await config.api.row.get(table._id!, row._id!)
|
||||||
|
expect(row.Story).toBeUndefined()
|
||||||
|
expect(row.Country).toEqual("Aussy")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe("search", () => {
|
describe("search", () => {
|
||||||
it("returns empty rows from view when no schema is passed", async () => {
|
it("returns empty rows from view when no schema is passed", async () => {
|
||||||
const rows = await Promise.all(
|
const rows = await Promise.all(
|
||||||
|
|
Loading…
Reference in New Issue