From 2aece868d68a7a57b2f3107b261c8fa0f31ed4d3 Mon Sep 17 00:00:00 2001 From: samaradel Date: Thu, 5 Dec 2024 13:12:32 +0200 Subject: [PATCH] Add function to get random number to validate zmount size --- packages/grid_client/tests/modules/zmount.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/grid_client/tests/modules/zmount.test.ts b/packages/grid_client/tests/modules/zmount.test.ts index b2544cce1c..959a474dc5 100644 --- a/packages/grid_client/tests/modules/zmount.test.ts +++ b/packages/grid_client/tests/modules/zmount.test.ts @@ -1,6 +1,7 @@ import { validate } from "class-validator"; import { Zmount } from "../../src"; +import { getRandomNumber } from "../../src/helpers/utils"; describe("Zmount Class", () => { let zmount: Zmount; @@ -40,13 +41,14 @@ describe("Zmount Class", () => { expect(() => (zmount.size = maxSize)).toThrow(); }); - it("should pass validation if size is within the valid range", async () => { + it("should pass validation if size is a valid number within the range", async () => { + const validSize = getRandomNumber(minSize, maxSize); zmount.size = validSize; - const errors = await validate(zmount); expect(errors.length).toBe(0); }); }); + describe("challenge method", () => { it("should return the size as a string", () => { zmount.size = validSize;