@@ -21,7 +21,7 @@ describe("BlocklistDal", () => {
2121 await BlacklistDal . add ( { name, email } ) ;
2222
2323 //THEN
24- expect (
24+ await expect (
2525 BlacklistDal . getCollection ( ) . findOne ( {
2626 emailHash : BlacklistDal . hash ( email ) ,
2727 } )
@@ -30,7 +30,7 @@ describe("BlocklistDal", () => {
3030 timestamp : now ,
3131 } ) ;
3232
33- expect (
33+ await expect (
3434 BlacklistDal . getCollection ( ) . findOne ( {
3535 usernameHash : BlacklistDal . hash ( name ) ,
3636 } )
@@ -52,7 +52,7 @@ describe("BlocklistDal", () => {
5252 await BlacklistDal . add ( { name, email, discordId } ) ;
5353
5454 //THEN
55- expect (
55+ await expect (
5656 BlacklistDal . getCollection ( ) . findOne ( {
5757 discordIdHash : BlacklistDal . hash ( discordId ) ,
5858 } )
@@ -75,21 +75,21 @@ describe("BlocklistDal", () => {
7575 await BlacklistDal . add ( { name, email : email2 } ) ;
7676
7777 //THEN
78- expect (
78+ await expect (
7979 BlacklistDal . getCollection ( )
8080 . find ( {
8181 usernameHash : BlacklistDal . hash ( name ) ,
8282 } )
8383 . toArray ( )
8484 ) . resolves . toHaveLength ( 1 ) ;
85- expect (
85+ await expect (
8686 BlacklistDal . getCollection ( )
8787 . find ( {
8888 emailHash : BlacklistDal . hash ( email ) ,
8989 } )
9090 . toArray ( )
9191 ) . resolves . toHaveLength ( 1 ) ;
92- expect (
92+ await expect (
9393 BlacklistDal . getCollection ( )
9494 . find ( {
9595 emailHash : BlacklistDal . hash ( email2 ) ,
@@ -111,7 +111,7 @@ describe("BlocklistDal", () => {
111111 await BlacklistDal . add ( { name : name2 , email } ) ;
112112
113113 //THEN
114- expect (
114+ await expect (
115115 BlacklistDal . getCollection ( )
116116 . find ( {
117117 emailHash : BlacklistDal . hash ( email ) ,
@@ -136,7 +136,7 @@ describe("BlocklistDal", () => {
136136
137137 //THEN
138138
139- expect (
139+ await expect (
140140 BlacklistDal . getCollection ( )
141141 . find ( {
142142 discordIdHash : BlacklistDal . hash ( discordId ) ,
@@ -156,34 +156,34 @@ describe("BlocklistDal", () => {
156156
157157 //WHEN / THEN
158158 //by name
159- expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
160- expect (
159+ await expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
160+ await expect (
161161 BlacklistDal . contains ( { name : name . toUpperCase ( ) } )
162162 ) . resolves . toBeTruthy ( ) ;
163- expect (
163+ await expect (
164164 BlacklistDal . contains ( { name, email : "unknown" , discordId : "unknown" } )
165165 ) . resolves . toBeTruthy ( ) ;
166166
167167 //by email
168- expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
169- expect (
168+ await expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
169+ await expect (
170170 BlacklistDal . contains ( { email : email . toUpperCase ( ) } )
171171 ) . resolves . toBeTruthy ( ) ;
172- expect (
172+ await expect (
173173 BlacklistDal . contains ( { name : "unknown" , email, discordId : "unknown" } )
174174 ) . resolves . toBeTruthy ( ) ;
175175
176176 //by discordId
177- expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeTruthy ( ) ;
178- expect (
177+ await expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeTruthy ( ) ;
178+ await expect (
179179 BlacklistDal . contains ( { discordId : discordId . toUpperCase ( ) } )
180180 ) . resolves . toBeTruthy ( ) ;
181- expect (
181+ await expect (
182182 BlacklistDal . contains ( { name : "unknown" , email : "unknown" , discordId } )
183183 ) . resolves . toBeTruthy ( ) ;
184184
185185 //by name and email and discordId
186- expect (
186+ await expect (
187187 BlacklistDal . contains ( { name, email, discordId } )
188188 ) . resolves . toBeTruthy ( ) ;
189189 } ) ;
@@ -193,20 +193,24 @@ describe("BlocklistDal", () => {
193193 await BlacklistDal . add ( { name :
"test2" , email :
"[email protected] " } ) ; 194194
195195 //WHEN / THEN
196- expect ( BlacklistDal . contains ( { name : "unknown" } ) ) . resolves . toBeFalsy ( ) ;
197- expect ( BlacklistDal . contains ( { email : "unknown" } ) ) . resolves . toBeFalsy ( ) ;
198- expect (
196+ await expect (
197+ BlacklistDal . contains ( { name : "unknown" } )
198+ ) . resolves . toBeFalsy ( ) ;
199+ await expect (
200+ BlacklistDal . contains ( { email : "unknown" } )
201+ ) . resolves . toBeFalsy ( ) ;
202+ await expect (
199203 BlacklistDal . contains ( { discordId : "unknown" } )
200204 ) . resolves . toBeFalsy ( ) ;
201- expect (
205+ await expect (
202206 BlacklistDal . contains ( {
203207 name : "unknown" ,
204208 email : "unknown" ,
205209 discordId : "unknown" ,
206210 } )
207211 ) . resolves . toBeFalsy ( ) ;
208212
209- expect ( BlacklistDal . contains ( { } ) ) . resolves . toBeFalsy ( ) ;
213+ await expect ( BlacklistDal . contains ( { } ) ) . resolves . toBeFalsy ( ) ;
210214 } ) ;
211215 } ) ;
212216
@@ -222,12 +226,14 @@ describe("BlocklistDal", () => {
222226 await BlacklistDal . remove ( { name } ) ;
223227
224228 //THEN
225- expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeFalsy ( ) ;
226- expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
229+ await expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeFalsy ( ) ;
230+ await expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
227231
228232 //decoy still exists
229- expect ( BlacklistDal . contains ( { name : "test" } ) ) . resolves . toBeTruthy ( ) ;
230- expect (
233+ await expect (
234+ BlacklistDal . contains ( { name : "test" } )
235+ ) . resolves . toBeTruthy ( ) ;
236+ await expect (
231237 BlacklistDal . contains ( { email :
"[email protected] " } ) 232238 ) . resolves . toBeTruthy ( ) ;
233239 } ) ;
@@ -242,12 +248,14 @@ describe("BlocklistDal", () => {
242248 await BlacklistDal . remove ( { email } ) ;
243249
244250 //THEN
245- expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeFalsy ( ) ;
246- expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
251+ await expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeFalsy ( ) ;
252+ await expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
247253
248254 //decoy still exists
249- expect ( BlacklistDal . contains ( { name : "test" } ) ) . resolves . toBeTruthy ( ) ;
250- expect (
255+ await expect (
256+ BlacklistDal . contains ( { name : "test" } )
257+ ) . resolves . toBeTruthy ( ) ;
258+ await expect (
251259 BlacklistDal . contains ( { email :
"[email protected] " } ) 252260 ) . resolves . toBeTruthy ( ) ;
253261 } ) ;
@@ -267,16 +275,18 @@ describe("BlocklistDal", () => {
267275 await BlacklistDal . remove ( { discordId } ) ;
268276
269277 //THEN
270- expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeFalsy ( ) ;
271- expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
272- expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
278+ await expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeFalsy ( ) ;
279+ await expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
280+ await expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
273281
274282 //decoy still exists
275- expect ( BlacklistDal . contains ( { name : "test" } ) ) . resolves . toBeTruthy ( ) ;
276- expect (
283+ await expect (
284+ BlacklistDal . contains ( { name : "test" } )
285+ ) . resolves . toBeTruthy ( ) ;
286+ await expect (
277287 BlacklistDal . contains ( { email :
"[email protected] " } ) 278288 ) . resolves . toBeTruthy ( ) ;
279- expect (
289+ await expect (
280290 BlacklistDal . contains ( { discordId : "testDiscordId" } )
281291 ) . resolves . toBeTruthy ( ) ;
282292 } ) ;
@@ -296,16 +306,18 @@ describe("BlocklistDal", () => {
296306 await BlacklistDal . remove ( { name, email, discordId } ) ;
297307
298308 //THEN
299- expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeFalsy ( ) ;
300- expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeFalsy ( ) ;
301- expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeFalsy ( ) ;
309+ await expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeFalsy ( ) ;
310+ await expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeFalsy ( ) ;
311+ await expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeFalsy ( ) ;
302312
303313 //decoy still exists
304- expect ( BlacklistDal . contains ( { name : "test" } ) ) . resolves . toBeTruthy ( ) ;
305- expect (
314+ await expect (
315+ BlacklistDal . contains ( { name : "test" } )
316+ ) . resolves . toBeTruthy ( ) ;
317+ await expect (
306318 BlacklistDal . contains ( { email :
"[email protected] " } ) 307319 ) . resolves . toBeTruthy ( ) ;
308- expect (
320+ await expect (
309321 BlacklistDal . contains ( { discordId : "testDiscordId" } )
310322 ) . resolves . toBeTruthy ( ) ;
311323 } ) ;
@@ -322,9 +334,9 @@ describe("BlocklistDal", () => {
322334 await BlacklistDal . remove ( { } ) ;
323335
324336 //THEN
325- expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
326- expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
327- expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeTruthy ( ) ;
337+ await expect ( BlacklistDal . contains ( { email } ) ) . resolves . toBeTruthy ( ) ;
338+ await expect ( BlacklistDal . contains ( { name } ) ) . resolves . toBeTruthy ( ) ;
339+ await expect ( BlacklistDal . contains ( { discordId } ) ) . resolves . toBeTruthy ( ) ;
328340 } ) ;
329341 } ) ;
330342 describe ( "hash" , ( ) => {
0 commit comments