mirror of
https://github.com/MadsLorentzen/ai-job-search.git
synced 2026-09-17 16:46:24 +00:00
fix(jobnet-search): emit the /scrape contract fields in search output (#339)
Adds additive normalization so jobnet search output carries the cross-portal contract fields (company, location, date, deadline with the 1900-01-01 NotDisclosed sentinel mapped to null, and url). Emits the public /find-job/{jobAdId} route and corrects the skill's own stale /job/ documentation, which redirects anonymous visitors into the MitID login flow.
Co-authored-by: oscarbol09 <80536682+oscarbol09@users.noreply.github.com>
This commit is contained in:
@@ -127,4 +127,37 @@ describe("Jobnet search normalization", () => {
|
||||
});
|
||||
expect("description" in output.results[0]).toBe(false);
|
||||
});
|
||||
|
||||
test("additively emits the /scrape contract fields (company, location, date, deadline, url)", () => {
|
||||
const output = createSearchOutput(apiResponse(), { ...flags, limit: undefined });
|
||||
|
||||
expect(output.results).toHaveLength(2);
|
||||
expect(output.results[0]).toMatchObject({
|
||||
company: "Acme",
|
||||
location: null,
|
||||
date: "2026-07-01",
|
||||
deadline: null,
|
||||
url: "https://jobnet.dk/find-job/job-1",
|
||||
});
|
||||
expect(output.results[1]).toMatchObject({
|
||||
company: "Example Co",
|
||||
location: "København Ø",
|
||||
date: "2026-07-02",
|
||||
deadline: "2026-08-01",
|
||||
url: "https://jobnet.dk/find-job/job-2",
|
||||
});
|
||||
expect(output.results[0].hiringOrgName).toBe("Acme");
|
||||
expect(output.results[1].applicationDeadline).toBe("2026-08-01T23:59:00+02:00");
|
||||
});
|
||||
|
||||
test("maps Jobnet's undisclosed-deadline sentinel (1900-01-01) to null", () => {
|
||||
const response = apiResponse();
|
||||
response.jobAds[0].applicationDeadline = "1900-01-01T00:00:00+01:00";
|
||||
response.jobAds[0].applicationDeadlineStatus = "NotDisclosed";
|
||||
|
||||
const output = createSearchOutput(response, { ...flags, limit: undefined });
|
||||
|
||||
expect(output.results[0].deadline).toBeNull();
|
||||
expect(output.results[1].deadline).toBe("2026-08-01");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user