11import prismock from "../../../../../../tests/libs/__mocks__/prisma" ;
22
3+ import type { NextApiRequest } from "next" ;
34import { describe , expect , it , beforeEach } from "vitest" ;
45
5- import { WatchlistSeverity } from "@calcom/prisma/enums" ;
6-
76import { isLockedOrBlocked } from "../../../lib/utils/isLockedOrBlocked" ;
87
98describe ( "isLockedOrBlocked" , ( ) => {
@@ -18,21 +17,20 @@ describe("isLockedOrBlocked", () => {
1817 {
1918 type : "DOMAIN" ,
2019 value : "blocked.com" ,
21- severity : WatchlistSeverity . CRITICAL ,
2220 createdById : 1 ,
2321 } ,
2422 ] ,
2523 } ) ;
2624 } ) ;
2725
2826 it ( "should return false if no user in request" , async ( ) => {
29- const req = { userId : null , user : null } as any ;
27+ const req = { userId : null , user : null } as unknown as NextApiRequest ;
3028 const result = await isLockedOrBlocked ( req ) ;
3129 expect ( result ) . toBe ( false ) ;
3230 } ) ;
3331
3432 it ( "should return false if user has no email" , async ( ) => {
35- const req = { userId : 123 , user : { email : null } } as any ;
33+ const req = { userId : 123 , user : { email : null } } as unknown as NextApiRequest ;
3634 const result = await isLockedOrBlocked ( req ) ;
3735 expect ( result ) . toBe ( false ) ;
3836 } ) ;
@@ -44,7 +42,7 @@ describe("isLockedOrBlocked", () => {
4442 locked : true ,
4543 email : "test@example.com" ,
4644 } ,
47- } as any ;
45+ } as unknown as NextApiRequest ;
4846
4947 const result = await isLockedOrBlocked ( req ) ;
5048 expect ( result ) . toBe ( true ) ;
@@ -57,7 +55,7 @@ describe("isLockedOrBlocked", () => {
5755 locked : false ,
5856 email : "test@blocked.com" ,
5957 } ,
60- } as any ;
58+ } as unknown as NextApiRequest ;
6159
6260 const result = await isLockedOrBlocked ( req ) ;
6361 expect ( result ) . toBe ( true ) ;
@@ -70,7 +68,7 @@ describe("isLockedOrBlocked", () => {
7068 locked : false ,
7169 email : "test@example.com" ,
7270 } ,
73- } as any ;
71+ } as unknown as NextApiRequest ;
7472
7573 const result = await isLockedOrBlocked ( req ) ;
7674 expect ( result ) . toBe ( false ) ;
@@ -83,7 +81,7 @@ describe("isLockedOrBlocked", () => {
8381 locked : false ,
8482 email : "test@BLOCKED.COM" ,
8583 } ,
86- } as any ;
84+ } as unknown as NextApiRequest ;
8785
8886 const result = await isLockedOrBlocked ( req ) ;
8987 expect ( result ) . toBe ( true ) ;
0 commit comments