Something went wrong. Try again.
Browser extension: detect and subscribe to standard.site publications on ATProto substandard.blog
Something went wrong. Try again.
123456789101112131415161718import { describe, expect, it } from 'vitest'
import { HANDLE_NOT_FOUND, SIGN_IN_FAILED, signInFailureMessage } from './messages'
describe('signInFailureMessage', () => { it('calls an unresolvable handle by its short name', () => { expect(signInFailureMessage(new Error('Could not resolve handle'))).toBe(HANDLE_NOT_FOUND) expect(signInFailureMessage(new Error('HandleNotFound: alice.example'))).toBe(HANDLE_NOT_FOUND) expect(signInFailureMessage('invalid identifier')).toBe(HANDLE_NOT_FOUND) })
it('keeps other failures short rather than showing the library error', () => { const message = signInFailureMessage(new Error('fetch failed: ECONNREFUSED')) expect(message).toBe(SIGN_IN_FAILED) expect(message).not.toContain('ECONNREFUSED') })})