Fix row.spec.ts

This commit is contained in:
Sam Rose 2024-11-27 16:37:29 +00:00
parent 4feda79903
commit 78bbf90f17
No known key found for this signature in database
1 changed files with 8 additions and 27 deletions

View File

@ -3548,35 +3548,16 @@ if (descriptions.length) {
}) })
let resp = await config.api.row.search(table1._id!) let resp = await config.api.row.search(table1._id!)
expect(resp.rows).toEqual([ expect(resp.rows).toHaveLength(1)
expect.objectContaining({ expect(resp.rows[0]._id).toBe("%5B'1'%5D")
_id: "%5B'1'%5D", expect(resp.rows[0].many).toHaveLength(1)
table1Id: "1", expect(resp.rows[0].many[0]._id).toBe("%5B'2'%5D")
many: [
{
_id: "%5B'2'%5D",
primaryDisplay: "2",
},
],
tableId: table1._id,
}),
])
resp = await config.api.row.search(table2._id!) resp = await config.api.row.search(table2._id!)
expect(resp.rows).toEqual([ expect(resp.rows).toHaveLength(1)
expect.objectContaining({ expect(resp.rows[0]._id).toBe("%5B'2'%5D")
_id: "%5B'2'%5D", expect(resp.rows[0].one).toHaveLength(1)
table2Id: "2", expect(resp.rows[0].one[0]._id).toBe("%5B'1'%5D")
table1Ref: "1",
one: [
{
_id: "%5B'1'%5D",
primaryDisplay: "1",
},
],
tableId: table2._id,
}),
])
}) })
}) })
} }