Fix tests
This commit is contained in:
parent
76cacfaff0
commit
2cc924f9e7
|
@ -1033,7 +1033,7 @@ describe("/rows", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const view = await config.api.viewV2.create({
|
const view = await config.api.viewV2.create({
|
||||||
columns: ["name"],
|
schema: { name: {} },
|
||||||
})
|
})
|
||||||
const response = await config.api.viewV2.search(view.id)
|
const response = await config.api.viewV2.search(view.id)
|
||||||
|
|
||||||
|
@ -1102,7 +1102,7 @@ describe("/rows", () => {
|
||||||
const table = await config.createTable(userTable())
|
const table = await config.createTable(userTable())
|
||||||
const view = await config.api.viewV2.create({
|
const view = await config.api.viewV2.create({
|
||||||
tableId: table._id!,
|
tableId: table._id!,
|
||||||
columns: {
|
schema: {
|
||||||
name: { visible: true },
|
name: { visible: true },
|
||||||
surname: { visible: true },
|
surname: { visible: true },
|
||||||
address: { visible: true },
|
address: { visible: true },
|
||||||
|
@ -1150,7 +1150,7 @@ describe("/rows", () => {
|
||||||
const tableId = table._id!
|
const tableId = table._id!
|
||||||
const view = await config.api.viewV2.create({
|
const view = await config.api.viewV2.create({
|
||||||
tableId,
|
tableId,
|
||||||
columns: {
|
schema: {
|
||||||
name: { visible: true },
|
name: { visible: true },
|
||||||
address: { visible: true },
|
address: { visible: true },
|
||||||
},
|
},
|
||||||
|
@ -1203,7 +1203,7 @@ describe("/rows", () => {
|
||||||
const tableId = table._id!
|
const tableId = table._id!
|
||||||
const view = await config.api.viewV2.create({
|
const view = await config.api.viewV2.create({
|
||||||
tableId,
|
tableId,
|
||||||
columns: {
|
schema: {
|
||||||
name: { visible: true },
|
name: { visible: true },
|
||||||
address: { visible: true },
|
address: { visible: true },
|
||||||
},
|
},
|
||||||
|
@ -1231,7 +1231,7 @@ describe("/rows", () => {
|
||||||
const tableId = table._id!
|
const tableId = table._id!
|
||||||
const view = await config.api.viewV2.create({
|
const view = await config.api.viewV2.create({
|
||||||
tableId,
|
tableId,
|
||||||
columns: {
|
schema: {
|
||||||
name: { visible: true },
|
name: { visible: true },
|
||||||
address: { visible: true },
|
address: { visible: true },
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import * as setup from "./utilities"
|
import * as setup from "./utilities"
|
||||||
import {
|
import {
|
||||||
CreateViewRequest,
|
CreateViewRequest,
|
||||||
|
FieldSchema,
|
||||||
FieldType,
|
FieldType,
|
||||||
SortOrder,
|
SortOrder,
|
||||||
SortType,
|
SortType,
|
||||||
|
@ -42,8 +43,6 @@ describe("/v2/views", () => {
|
||||||
},
|
},
|
||||||
schema: {
|
schema: {
|
||||||
name: {
|
name: {
|
||||||
name: "name",
|
|
||||||
type: FieldType.STRING,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -108,7 +107,7 @@ describe("/v2/views", () => {
|
||||||
visible: false,
|
visible: false,
|
||||||
icon: "ic",
|
icon: "ic",
|
||||||
},
|
},
|
||||||
},
|
} as Record<string, FieldSchema>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const createdView = await config.api.viewV2.create(newView)
|
const createdView = await config.api.viewV2.create(newView)
|
||||||
|
@ -151,7 +150,7 @@ describe("/v2/views", () => {
|
||||||
presence: true,
|
presence: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
} as Record<string, FieldSchema>,
|
||||||
}
|
}
|
||||||
|
|
||||||
await config.api.viewV2.create(newView, {
|
await config.api.viewV2.create(newView, {
|
||||||
|
@ -173,7 +172,7 @@ describe("/v2/views", () => {
|
||||||
name: "Category",
|
name: "Category",
|
||||||
type: FieldType.STRING,
|
type: FieldType.STRING,
|
||||||
},
|
},
|
||||||
},
|
} as Record<string, FieldSchema>,
|
||||||
}
|
}
|
||||||
|
|
||||||
await config.api.viewV2.create(newView, {
|
await config.api.viewV2.create(newView, {
|
||||||
|
@ -316,7 +315,7 @@ describe("/v2/views", () => {
|
||||||
visible: false,
|
visible: false,
|
||||||
icon: "ic",
|
icon: "ic",
|
||||||
},
|
},
|
||||||
},
|
} as Record<string, FieldSchema>,
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(await config.api.viewV2.get(view.id)).toEqual({
|
expect(await config.api.viewV2.get(view.id)).toEqual({
|
||||||
|
@ -357,7 +356,7 @@ describe("/v2/views", () => {
|
||||||
presence: true,
|
presence: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
} as Record<string, FieldSchema>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expectStatus: 400,
|
expectStatus: 400,
|
||||||
|
@ -379,7 +378,7 @@ describe("/v2/views", () => {
|
||||||
name: "Category",
|
name: "Category",
|
||||||
type: FieldType.STRING,
|
type: FieldType.STRING,
|
||||||
},
|
},
|
||||||
},
|
} as Record<string, FieldSchema>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
expectStatus: 200,
|
expectStatus: 200,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { ViewV2, FieldSchema } from "../../../documents"
|
import { ViewV2, UIFieldMetadata } from "../../../documents"
|
||||||
|
|
||||||
export interface ViewResponse {
|
export interface ViewResponse {
|
||||||
data: ViewV2
|
data: ViewV2
|
||||||
|
@ -6,10 +6,10 @@ export interface ViewResponse {
|
||||||
|
|
||||||
export interface CreateViewRequest
|
export interface CreateViewRequest
|
||||||
extends Omit<ViewV2, "version" | "id" | "columns" | "schemaUI"> {
|
extends Omit<ViewV2, "version" | "id" | "columns" | "schemaUI"> {
|
||||||
schema?: Record<string, FieldSchema>
|
schema?: Record<string, UIFieldMetadata>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UpdateViewRequest
|
export interface UpdateViewRequest
|
||||||
extends Omit<ViewV2, "columns" | "schemaUI"> {
|
extends Omit<ViewV2, "columns" | "schemaUI"> {
|
||||||
schema?: Record<string, FieldSchema>
|
schema?: Record<string, UIFieldMetadata>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue