Commit 3d880ff
fix(test): stabilize flaky ResultsSearchQueryBuilder spec (#111916)
Applies a trio of strategies I've used in other flaky test cleanups:
* Instead of broadly typing with `userEvent.type`, switches to calling
`userEvent.click` to focus elements, `screen.findByRole` to wait until
the listbox is populated, and then manually calling `userEvent.keyboard`
to type. The granular events, each awaited, give more explicit waiting
for async operations in-between each.
* `delay:null` for `userEvent.keyboard`, to minimize the number of
renders triggered by typing
* After tests, waiting until the `combobox` role is found, to make sure
async setup from the components is done.
Fixes ENG-7201
Made with [Cursor](https://cursor.com)
---------
Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>1 parent ba5329c commit 3d880ff
File tree
1 file changed
+27
-10
lines changed- static/app/views/discover/results
1 file changed
+27
-10
lines changedLines changed: 27 additions & 10 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 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
55 | 63 | | |
56 | 64 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
60 | 71 | | |
61 | 72 | | |
62 | 73 | | |
| |||
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
84 | | - | |
| 95 | + | |
85 | 96 | | |
86 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
87 | 100 | | |
| 101 | + | |
| 102 | + | |
88 | 103 | | |
89 | | - | |
90 | | - | |
91 | | - | |
| 104 | + | |
92 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
93 | 110 | | |
94 | 111 | | |
0 commit comments