From d0d5cc68417b62327423163764511da3702e6612 Mon Sep 17 00:00:00 2001 From: James Collins Date: Fri, 24 Mar 2023 12:02:45 +1000 Subject: [PATCH] update tests to support new promise validation --- resources/js/tests/validate.test.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/js/tests/validate.test.ts b/resources/js/tests/validate.test.ts index f397342..64003b4 100644 --- a/resources/js/tests/validate.test.ts +++ b/resources/js/tests/validate.test.ts @@ -2,27 +2,27 @@ import { expect, describe, it } from "vitest"; import { Email } from "../helpers/validate"; describe("Email()", () => { - it("should return valid=false when an invalid email address is passed to the validate function", () => { + it("should return valid=false when an invalid email address is passed to the validate function", async () => { const v = Email(); - const result = v.validate("invalid email"); + const result = await v.validate("invalid email"); expect(result.valid).toBe(false); }); - it("should return valid=false when an invalid email address is passed to the validate function", () => { + it("should return valid=false when an invalid email address is passed to the validate function", async () => { const v = Email(); - const result = v.validate("fake@outlook"); + const result = await v.validate("fake@outlook"); expect(result.valid).toBe(false); }); - it("should return valid=true when an valid email address is passed to the validate function", () => { + it("should return valid=true when an valid email address is passed to the validate function", async () => { const v = Email(); - const result = v.validate("fake@outlook.com"); + const result = await v.validate("fake@outlook.com"); expect(result.valid).toBe(true); }); - it("should return valid=true when an valid email address is passed to the validate function", () => { + it("should return valid=true when an valid email address is passed to the validate function", async () => { const v = Email(); - const result = v.validate("fake@outlook.com.au"); + const result = await v.validate("fake@outlook.com.au"); expect(result.valid).toBe(true); }); });