Commit 4423cc9
fix(test): Fix flaky ResultsSearchQueryBuilder spec
Stabilize two flaky tests:
1. "does not show function tags in has: dropdown" — timed out at 5000ms
because userEvent.type started typing before async API responses
(feature flags, recent searches) had settled, causing re-renders
mid-typing that slowed each keystroke. Split into click + findByRole
(listbox) + keyboard to let initial renders complete before typing.
2. "shows normal tags in the dropdown" — act() warning from
SearchQueryBuilderCombobox because pending state updates from API
responses fired after test assertions completed. Add waitFor at end
to flush pending React state updates before teardown.
Also add MockApiClient.clearMockResponses() in beforeEach to prevent
mock leakage between tests.
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
Made-with: Cursor1 parent d7f2bcd commit 4423cc9
File tree
1 file changed
+25
-11
lines changed- static/app/views/discover/results
1 file changed
+25
-11
lines changedLines changed: 25 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
| |||
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | | - | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
52 | | - | |
53 | 59 | | |
54 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
55 | 63 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| |||
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
76 | | - | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
83 | 92 | | |
84 | | - | |
85 | 93 | | |
86 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
93 | 107 | | |
94 | 108 | | |
0 commit comments