Electron + React app that imports the full voip.ms SMS history into a local SQLite/FTS5 database, polls for new messages, sends SMS, resolves names/photos from GNOME EDS address books, and supports global and per-chat search with jump-to-message. Data lives in ~/Documents/voipms-desktop-data (covered by Deja Dup) with daily consistent snapshots. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
// Reads the real GNOME/EDS address books (read-only). Run with: LIVE=1 npm test
|
|
import { describe, expect, it } from 'vitest'
|
|
import { ContactDirectory, listSources } from '../src/main/contacts'
|
|
|
|
describe.skipIf(!process.env.LIVE)('live EDS contacts', () => {
|
|
it('lists enabled address books', async () => {
|
|
const sources = await listSources()
|
|
console.log(sources.map((s) => `${s.name} (${s.account})`).join('\n'))
|
|
expect(sources.length).toBeGreaterThan(0)
|
|
})
|
|
|
|
it('loads contacts with numbers and photos', async () => {
|
|
const dir = new ContactDirectory()
|
|
await dir.load()
|
|
const all = dir.list()
|
|
const withPhoto = all.filter((c) => c.photo)
|
|
const byBook = new Map<string, number>()
|
|
for (const c of all) byBook.set(c.book, (byBook.get(c.book) ?? 0) + 1)
|
|
console.log(`numbers: ${all.length}, with photo: ${withPhoto.length}`, Object.fromEntries(byBook))
|
|
const kinds = new Map<string, number>()
|
|
for (const c of withPhoto) {
|
|
const k = dir.photoFor(c.number)!.kind
|
|
kinds.set(k, (kinds.get(k) ?? 0) + 1)
|
|
}
|
|
console.log('photo kinds', Object.fromEntries(kinds))
|
|
expect(all.length).toBeGreaterThan(50)
|
|
dir.close()
|
|
})
|
|
})
|