diff --git a/packages/server/src/integration-test/row.spec.ts b/packages/server/src/integration-test/row.spec.ts index 3c65152871..ece0090a5a 100644 --- a/packages/server/src/integration-test/row.spec.ts +++ b/packages/server/src/integration-test/row.spec.ts @@ -41,7 +41,7 @@ describe("row api", () => { describe("create a row", () => { test("Given than no row exists, adding a new rows persists it", async () => { const tableName = faker.lorem.word() - let table = await config.createTable({ + const table = await config.createTable({ name: tableName, schema: { name: { @@ -62,12 +62,21 @@ describe("row api", () => { const newRow = { name: faker.name.fullName(), description: faker.lorem.paragraphs(), - value: faker.random.numeric(), + value: +faker.random.numeric(), } const res = await makeRequest("post", `/tables/${table._id}/rows`, newRow) expect(res.status).toBe(200) + + const persistedRows = await config.getRows(table._id!) + expect(persistedRows).toHaveLength(1) + expect(persistedRows).toEqual([ + expect.objectContaining({ + ...res.body.data, + ...newRow, + }), + ]) }) }) }) diff --git a/packages/server/src/tests/utilities/TestConfiguration.ts b/packages/server/src/tests/utilities/TestConfiguration.ts index b9d4470c88..ce4fa287a0 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.ts +++ b/packages/server/src/tests/utilities/TestConfiguration.ts @@ -413,7 +413,7 @@ class TestConfiguration { // TABLE - async updateTable(config?: any) { + async updateTable(config?: any): Promise