Add filesystem inventory (VCF, contact folders, project trees) into a reviewable YAML catalog, match against live OnlyOffice, and upsert only rows with approve:true. Includes FindPersonByEmail for email-keyed persons.
27 lines
577 B
Go
27 lines
577 B
Go
package catalog
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestMatchAgainstOO_emailThenName(t *testing.T) {
|
|
// MatchAgainstOO needs a live client; unit-test the helpers used by matching.
|
|
c := map[string]any{
|
|
"id": float64(42),
|
|
"isCompany": false,
|
|
"firstName": "Ada",
|
|
"lastName": "Lovelace",
|
|
"email": "ada@example.com",
|
|
"commonData": []any{
|
|
map[string]any{"infoType": "Email", "data": "ada.alt@example.com"},
|
|
},
|
|
}
|
|
if contactIDString(c) != "42" {
|
|
t.Fatal(contactIDString(c))
|
|
}
|
|
emails := contactEmails(c)
|
|
if len(emails) < 2 {
|
|
t.Fatalf("%v", emails)
|
|
}
|
|
}
|