Commit d3caa47
committed
test(ids): align extractPurpose tests with refactored priority chain
The previous suite had a test "extracts from description field" that
fed a bare `description: ...` string and expected it to be matched.
That was exactly the body-level fallback regex that produced the
"Analyzes provided dataset" false purpose on component-creation-guide.md
(reported by CodeRabbit on PR #747). The refactor in this PR
intentionally removed that match, so the test must be updated to
reflect the new contract.
Changes to the test file:
* Replaced "extracts from description field" with two replacement tests:
- "extracts from YAML frontmatter `description:` field" — feeds a
`---\ndescription: X\n---` block and expects extraction from it.
- "handles quoted YAML frontmatter description" — feeds
`description: "X"` inside frontmatter and expects the quotes to
be stripped.
* Added "falls back to ## Overview when no Purpose section" — covers
the new strategy 3 in the priority chain (many guides like
component-creation-guide.md use Overview instead of Purpose).
* Added TWO regression tests for the bug that motivated the refactor:
- "does NOT match body-level `description:` outside frontmatter" —
reproduces the exact component-creation-guide pattern (Overview
section + a fenced code block with `Task description:` inside)
and asserts the Overview wins.
- "does NOT extract from `description:` lines without YAML
frontmatter delimiters" — bare `description: X` without `---`
delimiters falls through to the `# Title` header, NOT to the
body line.
Test result: 79/79 pass. Existing 5 tests in the suite still pass.
Two new tests cover the YAML frontmatter branch (priority 1) and the
new `## Overview` branch (priority 3). Two regression tests lock in
the removal of the body-level matcher so it can't silently come back.1 parent 88068b8 commit d3caa47
1 file changed
Lines changed: 48 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
| 158 | + | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
164 | 176 | | |
165 | 177 | | |
166 | 178 | | |
| |||
177 | 189 | | |
178 | 190 | | |
179 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
180 | 226 | | |
181 | 227 | | |
182 | 228 | | |
| |||
0 commit comments