@@ -185,6 +185,18 @@ describe("isHashMatch", () => {
185185 const actual = await isHashMatch ( password , _hash )
186186 expect ( actual ) . toBe ( true )
187187 } )
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+ } )
188200} )
189201
190202describe ( "hashLegacy" , ( ) => {
@@ -325,7 +337,7 @@ describe("handlePasswordValidation", () => {
325337 } )
326338} )
327339
328- describe . only ( "isCookieValid" , ( ) => {
340+ describe ( "isCookieValid" , ( ) => {
329341 it ( "should be valid if hashed-password for SHA256 matches cookie.key" , async ( ) => {
330342 const isValid = await isCookieValid ( {
331343 passwordMethod : "SHA256" ,
@@ -384,7 +396,7 @@ describe.only("isCookieValid", () => {
384396 } )
385397} )
386398
387- describe . only ( "sanitizeString" , ( ) => {
399+ describe ( "sanitizeString" , ( ) => {
388400 it ( "should return an empty string if passed a type other than a string" , ( ) => {
389401 expect ( sanitizeString ( { } as string ) ) . toBe ( "" )
390402 } )
0 commit comments