Commit b06ca47
fix(test): stabilize flaky EventsSearchBar has: dropdown test (#111903)
The `has:` dropdown values come from `useTags()` which reads `TagStore`.
In this unit test, no parent page component calls
`loadOrganizationTags`, but `SearchQueryBuilder` still fires a `GET
/organizations/org-slug/tags/` request internally. Without a mock, that
request silently fails (mock client swallows it), leaving the dropdown
unreliably populated.
- Mock `/organizations/org-slug/tags/` so the `has:` dropdown is
deterministically populated
- `findByRole` instead of `getByRole` for elements that appear
asynchronously
- `waitFor` at end of each test to let pending state updates settle
before unmount
Fixes DAIN-1271
Made with [Cursor](https://cursor.com)
---------
Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>1 parent abe7c05 commit b06ca47
File tree
1 file changed
+27
-1
lines changed- static/app/views/dashboards/widgetBuilder/buildSteps/filterResultsStep
1 file changed
+27
-1
lines changedLines changed: 27 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
5 | 11 | | |
6 | 12 | | |
7 | 13 | | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
| |||
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
| |||
64 | 78 | | |
65 | 79 | | |
66 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
67 | 85 | | |
68 | 86 | | |
69 | 87 | | |
| |||
97 | 115 | | |
98 | 116 | | |
99 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
100 | 122 | | |
101 | 123 | | |
102 | 124 | | |
| |||
133 | 155 | | |
134 | 156 | | |
135 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
136 | 162 | | |
137 | 163 | | |
0 commit comments