MentraOS / mobile /src /utils /auth /authErrors.test.ts
Anirudh1950's picture
Add files using upload-large-folder tool
68465df verified
Raw History Blame Contribute Delete
520 Bytes
import {mapAuthError} from "./authErrors"
it.each([
["invalid_reset_link", "login:errors.invalidResetLink"],
["otp_expired", "login:errors.otpExpired"],
])("maps the sign-in screen's authError code %s to its message", (code, key) => {
expect(mapAuthError(code)).toBe(key)
})
it.each(["constructor", "toString", "__proto__"])("treats a link's %s as an unknown error, not a code", (code) => {
expect(typeof mapAuthError(code)).toBe("string")
expect(mapAuthError(code)).not.toMatch(/^function/)
})