From b6d66631d4ded082e0164c3c077640d78663df70 Mon Sep 17 00:00:00 2001 From: "Kevin Tun (aider)" Date: Wed, 21 Aug 2024 17:55:11 -0500 Subject: [PATCH] test: add checks for "LOADING" text in authorization tests --- packages/auth/src/__tests__/useAuthorization.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/auth/src/__tests__/useAuthorization.test.tsx b/packages/auth/src/__tests__/useAuthorization.test.tsx index 1642db9d1..7eac52b93 100644 --- a/packages/auth/src/__tests__/useAuthorization.test.tsx +++ b/packages/auth/src/__tests__/useAuthorization.test.tsx @@ -30,7 +30,8 @@ test("A user without a matching role is unauthorized", async () => { isAuthenticated: true, }) - render() + const { getByText } = render() + expect(getByText("LOADING")).toBeInTheDocument() expect(await screen.findByText("UNAUTHORIZED")).toBeInTheDocument() }) @@ -40,6 +41,7 @@ test("A user with a matching role is authorized", async () => { isAuthenticated: true, }) - render() + const { getByText } = render() + expect(getByText("LOADING")).toBeInTheDocument() expect(await screen.findByText("AUTHORIZED")).toBeInTheDocument() })