-
Notifications
You must be signed in to change notification settings - Fork 4
feat: JD matching v1 (deterministic skill + phrase coverage) #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9ac9575
feat: JD matching v1 (deterministic skill + phrase coverage)
Samhit21 50cfe00
fix: show JD textarea alongside dropzone + surface weighted-coverage …
Samhit21 9283d93
refactor: address PR review on #41 (regex-utils, noun-cap surfacing, …
Samhit21 ec40d19
Merge branch 'main' into sa/jd-matching-v1
Samhit21 ba2be56
fix: noun-cap copy matches what the code does (first-N, not "most inf…
Samhit21 bf388d3
Merge branch 'main' into sa/jd-matching-v1
Samhit21 666c1f2
refactor: stripBoilerplate — collapse identical blank-line branches +…
Samhit21 d5e4482
Merge branch 'main' into sa/jd-matching-v1
s-annam acf3754
refactor: address PR #41 review — shared Card, skill labels, JD a11y
s-annam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // Copyright 2026 The resumelint Authors | ||
|
|
||
| import { describe, it, expect } from "vitest"; | ||
| import { createElement } from "react"; | ||
| import { renderToStaticMarkup } from "react-dom/server"; | ||
| import { JdMatch } from "./JdMatch.tsx"; | ||
| import type { ExtractedTerm } from "../../lib/jd-match/extract-jd-terms.ts"; | ||
| import type { CoverageResult } from "../../lib/jd-match/coverage.ts"; | ||
|
|
||
| function term( | ||
| id: string, | ||
| display: string, | ||
| source: ExtractedTerm["source"], | ||
| ): ExtractedTerm { | ||
| return { id, display, source, snippet: `…snippet for ${display}…` }; | ||
| } | ||
|
|
||
| describe("JdMatch", () => { | ||
| it("renders an N-of-M headline rather than a percent-match label", () => { | ||
| const covered = [term("react", "react", "skill")]; | ||
| const missing = [ | ||
| term("kubernetes", "kubernetes", "skill"), | ||
| term("Distributed Systems", "Distributed Systems", "noun"), | ||
| ]; | ||
| const terms = [...covered, ...missing]; | ||
| const coverage: CoverageResult = { | ||
| covered, | ||
| missing, | ||
| score: 25, | ||
| weights: { skill: 1, noun: 0.5 }, | ||
| }; | ||
| const html = renderToStaticMarkup(createElement(JdMatch, { coverage, terms })); | ||
| expect(html).toContain("Your resume mentions 1 of 3 terms from this JD."); | ||
| expect(html).not.toMatch(/\d+%\s*match/i); | ||
| }); | ||
|
|
||
| it("flags the diagnostic framing, not 'will pass ATS' framing", () => { | ||
| const coverage: CoverageResult = { | ||
| covered: [], | ||
| missing: [], | ||
| score: 0, | ||
| weights: { skill: 1, noun: 0.5 }, | ||
| }; | ||
| const html = renderToStaticMarkup(createElement(JdMatch, { coverage, terms: [] })); | ||
| expect(html.toLowerCase()).toContain("diagnostic, not a verdict"); | ||
| expect(html.toLowerCase()).not.toMatch(/will\s+(pass|fail)/); | ||
| expect(html.toLowerCase()).not.toContain("ats"); | ||
| }); | ||
|
|
||
| it("renders covered and missing terms with their display strings", () => { | ||
| const covered = [term("react", "react", "skill")]; | ||
| const missing = [term("kubernetes", "kubernetes", "skill")]; | ||
| const terms = [...covered, ...missing]; | ||
| const coverage: CoverageResult = { | ||
| covered, | ||
| missing, | ||
| score: 50, | ||
| weights: { skill: 1, noun: 0.5 }, | ||
| }; | ||
| const html = renderToStaticMarkup(createElement(JdMatch, { coverage, terms })); | ||
| expect(html).toContain("Covered (1)"); | ||
| expect(html).toContain("Missing (1)"); | ||
| expect(html).toContain(">react<"); | ||
| expect(html).toContain(">kubernetes<"); | ||
| }); | ||
|
|
||
| it("surfaces the '+N more' footnote when noun-pass cap silences hits", () => { | ||
| const coverage: CoverageResult = { | ||
| covered: [], | ||
| missing: [], | ||
| score: 0, | ||
| weights: { skill: 1, noun: 0.5 }, | ||
| }; | ||
| const html = renderToStaticMarkup( | ||
| createElement(JdMatch, { coverage, terms: [], nounsDropped: 7 }), | ||
| ); | ||
| expect(html).toContain("+7 more capitalized phrases"); | ||
| }); | ||
|
|
||
| it("omits the footnote when no hits were silenced", () => { | ||
| const coverage: CoverageResult = { | ||
| covered: [], | ||
| missing: [], | ||
| score: 0, | ||
| weights: { skill: 1, noun: 0.5 }, | ||
| }; | ||
| const html = renderToStaticMarkup( | ||
| createElement(JdMatch, { coverage, terms: [], nounsDropped: 0 }), | ||
| ); | ||
| expect(html).not.toContain("not surfaced"); | ||
| expect(html).not.toContain("not shown"); | ||
| expect(html).not.toMatch(/\+\d+ more/); | ||
| }); | ||
|
|
||
| it("emits the snippet on the term row as a hover tooltip (title attribute)", () => { | ||
| const t = term("react", "react", "skill"); | ||
| const coverage: CoverageResult = { | ||
| covered: [t], | ||
| missing: [], | ||
| score: 100, | ||
| weights: { skill: 1, noun: 0.5 }, | ||
| }; | ||
| const html = renderToStaticMarkup( | ||
| createElement(JdMatch, { coverage, terms: [t] }), | ||
| ); | ||
| expect(html).toContain(`title="${t.snippet}"`); | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nit]: The textarea has a placeholder and a sibling
<h2>, but no programmatic label — a screen reader announces only the placeholder text. Consideraria-label="Job description"(or wire the<h2>viaid+aria-labelledby).