0caaf681d8
Harden live log init with safe per-entry decrypt, stable loading state, and no parallel list scan in live mode. Improve multi-sail picker UX, stop WebAuthn retry after user cancel, redirect 127.0.0.1 to localhost, and tolerate missing appearance prefs table. Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
552 B
TypeScript
20 lines
552 B
TypeScript
import { describe, expect, it, vi } from 'vitest'
|
|
import { tryDecryptEntryPayload } from './quickEventLog.js'
|
|
|
|
vi.mock('./crypto.js', () => ({
|
|
decryptJson: vi.fn(async (_c: string, _i: string, _t: string) => {
|
|
throw new Error('decrypt failed')
|
|
}),
|
|
encryptJson: vi.fn()
|
|
}))
|
|
|
|
describe('tryDecryptEntryPayload', () => {
|
|
it('returns null when decryption fails', async () => {
|
|
const result = await tryDecryptEntryPayload(
|
|
{ encryptedData: 'x', iv: 'y', tag: 'z' },
|
|
new ArrayBuffer(32)
|
|
)
|
|
expect(result).toBeNull()
|
|
})
|
|
})
|