21 lines
832 B
TypeScript
21 lines
832 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|||
|
|
import { explainReceiveAddressFailure } from '../bitcoinReceive'
|
||
|
|
|
||
|
|
describe('explainReceiveAddressFailure', () => {
|
||
|
|
it('explains locked wallet failures', () => {
|
||
|
|
expect(explainReceiveAddressFailure(new Error('wallet locked'))).toContain('wallet is locked')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('explains sync failures', () => {
|
||
|
|
expect(explainReceiveAddressFailure(new Error('chain backend is still syncing'))).toContain('still syncing')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('explains empty address responses', () => {
|
||
|
|
expect(explainReceiveAddressFailure(new Error('LND did not return a Bitcoin address'))).toContain('did not return an address')
|
||
|
|
})
|
||
|
|
|
||
|
|
it('explains lnd transport failures', () => {
|
||
|
|
expect(explainReceiveAddressFailure(new Error('LND REST connection failed'))).toContain('not responding cleanly')
|
||
|
|
})
|
||
|
|
})
|