@@ -185,6 +185,18 @@ describe("isHashMatch", () => {
185
185
const actual = await isHashMatch ( password , _hash )
186
186
expect ( actual ) . toBe ( true )
187
187
} )
188
+ it ( "should return false if the password is empty" , async ( ) => {
189
+ const password = ""
190
+ const _hash = "$argon2i$v=19$m=4096,t=3,p=1$EAoczTxVki21JDfIZpTUxg$rkXgyrW4RDGoDYrxBFD4H2DlSMEhP4h+Api1hXnGnFY"
191
+ const actual = await isHashMatch ( password , _hash )
192
+ expect ( actual ) . toBe ( false )
193
+ } )
194
+ it ( "should return false if the hash is empty" , async ( ) => {
195
+ const password = "hellowpasssword"
196
+ const _hash = ""
197
+ const actual = await isHashMatch ( password , _hash )
198
+ expect ( actual ) . toBe ( false )
199
+ } )
188
200
} )
189
201
190
202
describe ( "hashLegacy" , ( ) => {
@@ -325,7 +337,7 @@ describe("handlePasswordValidation", () => {
325
337
} )
326
338
} )
327
339
328
- describe . only ( "isCookieValid" , ( ) => {
340
+ describe ( "isCookieValid" , ( ) => {
329
341
it ( "should be valid if hashed-password for SHA256 matches cookie.key" , async ( ) => {
330
342
const isValid = await isCookieValid ( {
331
343
passwordMethod : "SHA256" ,
@@ -384,7 +396,7 @@ describe.only("isCookieValid", () => {
384
396
} )
385
397
} )
386
398
387
- describe . only ( "sanitizeString" , ( ) => {
399
+ describe ( "sanitizeString" , ( ) => {
388
400
it ( "should return an empty string if passed a type other than a string" , ( ) => {
389
401
expect ( sanitizeString ( { } as string ) ) . toBe ( "" )
390
402
} )
0 commit comments