Fix types

This commit is contained in:
Adria Navarro 2023-08-07 14:16:23 +03:00
parent 98a5d36d57
commit c6fba3a827
1 changed files with 13 additions and 5 deletions

View File

@ -62,7 +62,7 @@ describe("/v2/views", () => {
name: generator.name(), name: generator.name(),
tableId: config.table!._id!, tableId: config.table!._id!,
primaryDisplay: generator.word(), primaryDisplay: generator.word(),
query: { allOr: false, equal: { field: "value" } }, query: [{ operator: "equal", field: "field", value: "value" }],
sort: { sort: {
field: "fieldToSort", field: "fieldToSort",
order: SortOrder.DESCENDING, order: SortOrder.DESCENDING,
@ -190,7 +190,7 @@ describe("/v2/views", () => {
const tableId = config.table!._id! const tableId = config.table!._id!
await config.api.viewV2.update({ await config.api.viewV2.update({
...view, ...view,
query: { equal: { newField: "thatValue" } }, query: [{ operator: "equal", field: "newField", value: "thatValue" }],
}) })
expect(await config.api.table.get(tableId)).toEqual({ expect(await config.api.table.get(tableId)).toEqual({
@ -198,7 +198,9 @@ describe("/v2/views", () => {
views: { views: {
[view.name]: { [view.name]: {
...view, ...view,
query: { equal: { newField: "thatValue" } }, query: [
{ operator: "equal", field: "newField", value: "thatValue" },
],
schema: expect.anything(), schema: expect.anything(),
}, },
}, },
@ -216,7 +218,13 @@ describe("/v2/views", () => {
tableId, tableId,
name: view.name, name: view.name,
primaryDisplay: generator.word(), primaryDisplay: generator.word(),
query: { equal: { [generator.word()]: generator.word() } }, query: [
{
operator: "equal",
field: generator.word(),
value: generator.word(),
},
],
sort: { sort: {
field: generator.word(), field: generator.word(),
order: SortOrder.DESCENDING, order: SortOrder.DESCENDING,
@ -285,7 +293,7 @@ describe("/v2/views", () => {
{ {
...view, ...view,
tableId: generator.guid(), tableId: generator.guid(),
query: { equal: { newField: "thatValue" } }, query: [{ operator: "equal", field: "newField", value: "thatValue" }],
}, },
{ expectStatus: 404 } { expectStatus: 404 }
) )