From 6a1589ba649ce323f91e438baec6fa7db21378d5 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 18 Jan 2023 16:48:18 +0000 Subject: [PATCH] Adding more tests --- packages/server/src/integration-test/row.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/server/src/integration-test/row.spec.ts b/packages/server/src/integration-test/row.spec.ts index 7b176549d1..e7203cff45 100644 --- a/packages/server/src/integration-test/row.spec.ts +++ b/packages/server/src/integration-test/row.spec.ts @@ -128,5 +128,21 @@ describe("row api", () => { expect(res.body.data).toEqual(expect.objectContaining(rowData)) }) + + test("Given than a table have a multiple rows, a single row can be retrieved successfully", async () => { + await Promise.all(Array(5).map(() => config.createRow(createRandomRow()))) + const rowData = createRandomRow() + const row = await config.createRow(rowData) + await Promise.all(Array(2).map(() => config.createRow(createRandomRow()))) + + const res = await makeRequest( + "get", + `/tables/${postgresTable._id}/rows/${row._id}` + ) + + expect(res.status).toBe(200) + + expect(res.body.data).toEqual(expect.objectContaining(rowData)) + }) }) })