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