From b8400294d54b1baef60de5e95a835918f21a8656 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 23 May 2024 14:53:17 +0200 Subject: [PATCH] Add extra tests --- .../server/src/sdk/app/rows/tests/utils.spec.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/server/src/sdk/app/rows/tests/utils.spec.ts b/packages/server/src/sdk/app/rows/tests/utils.spec.ts index acd4281256..4c44791135 100644 --- a/packages/server/src/sdk/app/rows/tests/utils.spec.ts +++ b/packages/server/src/sdk/app/rows/tests/utils.spec.ts @@ -194,7 +194,7 @@ describe("validate", () => { }, } - it.each(["10:00", "15:00", `9:${minute()}`, "16:34"])( + it.each(["10:00", "15:00", `9:${minute()}`, "16:34", "00:00"])( "should accept values in range (%s)", async time => { const row = { time } @@ -202,6 +202,18 @@ describe("validate", () => { expect(output.valid).toBe(true) } ) + + it.each(["10:01", "14:59:59", `12:${minute()}`])( + "should reject values out range (%s)", + async time => { + const row = { time } + const output = await validate({ table, tableId: table._id!, row }) + expect(output.valid).toBe(false) + expect(output.errors).toEqual({ + time: ["must be no later than 10:00"], + }) + } + ) }) }) })