Commit 60505ee
authored
[Discover] Pre-migration cleanup: additional within-plugin dedupe opportunities (#271647)
- Closes #270615
## Summary
### Area 1: Field-data behavior — MERGED
**Files changed:**
- Deleted
`src/platform/test/functional/apps/discover/group2_data_grid2/_data_grid_field_data.ts`
- Removed its `loadTestFile` entry from `group2_data_grid2/index.ts`
- Moved 2 unique grid-specific tests (`doc view should show exact header
fields`, `doc view should sort ascending`) into
`group5/_field_data_with_fields_api.ts`
**Why:** 4 of 6 tests were byte-for-byte duplicates of tests already in
`_field_data_with_fields_api.ts` (php hit count, php highlight,
type:apache hit count, bad syntax error). The 2 remaining grid-specific
tests were merged into the canonical file, eliminating an entire test
file and its setup overhead from the `group2_data_grid2` CI config.
---
### Area 4: Embeddable dashboard round-trip — MERGED WITH SHARED HELPER
**Files changed:**
- Deleted
`src/platform/test/functional/apps/discover/embeddable_2/_esql_embeddable.ts`
- Removed its `loadTestFile` entry from `embeddable_2/index.ts`
- Restructured `embeddable/_saved_search_embeddable.ts` to add a
`describeEditSessionTests` helper that generates 3 edit-session tests
(linked edit + return, by-value edit + return, save-as-new) for any
panel type
- The helper is called twice: once for saved search panels, once for
ES|QL panels
- Both use the same `discover.getSavedSearchDocumentCount()` assertion
(same UI component for both panel types)
**Why:** 3 of 4 ES|QL tests repeated the same edit-session navigation
contract as the saved-search tests. A shared helper now exercises both
panel types with zero code duplication, while each type gets its own
test runs to catch type-specific regressions. The 1 unique "add ES|QL
panel" smoke test is covered implicitly by the linked-session edit test.
---
### Area 2: Context navigation — REPOSITIONED
**Files changed:**
- Moved the "should open the context view with the same columns" test in
`group2_data_grid1/_data_grid_context.ts` to run **after** the anchor
test instead of before it
**Why:** Previously this test ran first (on Discover, not on the context
view) making it a duplicate of what `context/_discover_navigation.ts`
checks. By placing it after the anchor test navigates to context, it now
verifies that the **context view** inherited the correct columns — a
different and valid assertion.
### Area 5: Sidebar/doc viewer search-flow
**Why not changed:** The 8 overlapping test titles test the same
*scenarios* (wildcard, fuzzy, etc.) but on completely different UI
surfaces with different APIs (`unifiedFieldList.findFieldByName` vs
`discover.findFieldByNameOrValueInDocViewer`), different assertion
strategies (exact field name arrays vs DOM cell counts), and different
expected values (4 vs 3 fields for fuzzy search due to different search
corpora). They run on separate CI configs so deduplication saves 0s. A
shared helper would be entirely parameters — harder to read than the
original tests.
### Area 3: Read-only badge privilege checks
**Why not changed:** 2 of 3 files have already been migrated to Scout.
The remaining `discover_security.ts` has unique Discover-specific tests
(share URLs, CSV export, alias access) with no remaining overlap.
### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.1 parent 17e140c commit 60505ee
7 files changed
Lines changed: 151 additions & 313 deletions
File tree
- src/platform/test/functional/apps/discover
- embeddable_2
- embeddable
- group2_data_grid1
- group2_data_grid2
- group5
Lines changed: 128 additions & 78 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | 203 | | |
260 | 204 | | |
261 | 205 | | |
| |||
326 | 270 | | |
327 | 271 | | |
328 | 272 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | 273 | | |
352 | 274 | | |
353 | 275 | | |
| |||
372 | 294 | | |
373 | 295 | | |
374 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
375 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
376 | 426 | | |
Lines changed: 0 additions & 129 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 68 | | |
74 | 69 | | |
75 | 70 | | |
| |||
81 | 76 | | |
82 | 77 | | |
83 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
| |||
0 commit comments