Commit dd73bd9
test(glossary): make selectActiveGlossary selector robust (#27566)
* test(glossary): make selectActiveGlossary selector robust
Scope the menuitem lookup to [data-testid="glossary-left-panel"] and
require an exact name match so the helper can no longer pick up an
element from another dropdown (e.g. the Add-button glossary picker) or
silently mis-click via .first() when many glossaries share the "PW % "
prefix. The label argument is documented as the rendered label
(displayName ?? name).
Update createGlossaryTerms and the six Glossary.spec.ts callers that
were passing glossary.data.name (which never matches the rendered
displayName) to pass the displayName instead. This is the underlying
cause of the flakiness in "Approve and reject glossary term from
Glossary Listing".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(glossary): fill displayName in createGlossary so UI-created glossaries match strict sidebar lookup
The previous commit made selectActiveGlossary match the sidebar
menuitem by displayName with exact: true. That assumed every glossary
in a test had its displayName rendered in the sidebar. UI-created
glossaries (via the createGlossary helper) only filled the name field,
so the server had no displayName and the sidebar rendered the raw
name — the exact-match lookup then hung until the 180s test timeout.
Fill the display-name field in createGlossary, and look up the
menuitem in verifyGlossaryDetails by displayName as well. This aligns
UI-created glossaries with API-created ones and unblocks the three
tests that were failing on this PR:
- Glossary & terms creation for reviewer as user
- Glossary & terms creation for reviewer as team
- Approve and reject glossary term from Glossary Listing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Siddhant <siddhant@MacBook-Pro-621.local>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0deb78b commit dd73bd9
2 files changed
Lines changed: 20 additions & 10 deletions
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
| 457 | + | |
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| |||
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
| 270 | + | |
| 271 | + | |
262 | 272 | | |
263 | 273 | | |
264 | 274 | | |
| |||
322 | 332 | | |
323 | 333 | | |
324 | 334 | | |
325 | | - | |
| 335 | + | |
326 | 336 | | |
327 | 337 | | |
328 | 338 | | |
| |||
761 | 771 | | |
762 | 772 | | |
763 | 773 | | |
764 | | - | |
| 774 | + | |
765 | 775 | | |
766 | 776 | | |
767 | 777 | | |
| |||
0 commit comments