Add application workflow and lead analytics
Test and publish / test (push) Successful in 2m33s
Test and publish / publish (push) Successful in 11m9s

This commit is contained in:
2026-10-23 20:45:48 +01:00
parent d0074aea46
commit 1147bc5697
35 changed files with 4337 additions and 131 deletions
+7 -3
View File
@@ -193,7 +193,11 @@ func TestJobCaptureExtractErrors(t *testing.T) {
// page text must be cut to maxPageRunes before it is sent to Claude.
func TestJobCaptureExtractTruncatesAndRelays(t *testing.T) {
london := "London"
f := &fakeExtractor{posting: claude.JobPosting{JobTitle: "Engineer", Company: "Acme", Location: &london}}
salary := "£70k"
arrangement := "Hybrid"
source := "LinkedIn"
requisition := "REQ-9"
f := &fakeExtractor{posting: claude.JobPosting{JobTitle: "Engineer", Company: "Acme", Location: &london, SalaryRange: &salary, WorkArrangement: &arrangement, ApplicationSource: &source, RequisitionID: &requisition}}
post := extractRoute(f)
long, _ := json.Marshal(map[string]string{"url": "https://x.com/1", "title": "Engineer | Acme", "text": strings.Repeat("é", maxPageRunes+500)})
@@ -207,8 +211,8 @@ func TestJobCaptureExtractTruncatesAndRelays(t *testing.T) {
if n := len([]rune(f.got[2])); n != maxPageRunes {
t.Fatalf("forwarded %d runes, want %d", n, maxPageRunes)
}
// The body is the userscript's contract: these four keys.
if rec.Body.String() != `{"jobTitle":"Engineer","company":"Acme","location":"London","notes":null}` {
// The body is the userscript's contract, including metadata when extracted.
if rec.Body.String() != `{"jobTitle":"Engineer","company":"Acme","location":"London","notes":null,"salaryRange":"£70k","workArrangement":"Hybrid","applicationSource":"LinkedIn","requisitionId":"REQ-9"}` {
t.Fatalf("body = %s", rec.Body)
}