kibana/x-pack/test/api_integration
Viduni Wickramarachchi 6d5acfca0d
[Obs AI Assistant] Delete user instruction if text is empty (#221560)
Closes https://github.com/elastic/kibana/issues/220342

## Summary

As of today, when the user clears the user instruction, the entry is not
deleted. Instead the text is cleared from the entry. This has caused
problems in the past.

This PR implements the change where, if a user clears the user
instruction, the entry will be deleted.

Note: Entry deletion via functional tests appears to be flaky due to
issues with clearing the instruction from the editor. Therefore, to
avoid introducing a flaky test, this was covered via a unit test. Added
functional tests to cover scenarios such as creating an instruction,
editing an instruction.

### Screen recording


https://github.com/user-attachments/assets/35a530ca-5a96-4a17-a4b8-d0e4002c1120


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-05-27 17:12:39 -04:00
..
apis [ska][x-pack] relocate platform tests [4] (#219691) 2025-05-07 19:13:04 +02:00
deployment_agnostic [Obs AI Assistant] Delete user instruction if text is empty (#221560) 2025-05-27 17:12:39 -04:00
fixtures/kbn_archiver
services [Automatic Migrations] Siem migrations new endpoint (#219597) 2025-05-22 17:23:17 +02:00
config.ts
ftr_provider_context.d.ts