Refactor DuoChatPanel::Component spec to use render_inline

What does this MR do and why?

Addresses the test-related follow-up items from #596538 (closed) (a follow-up from !228881 (merged)):

  • Refactors ee/spec/components/duo_chat_panel/component_spec.rb to use render_inline and assert against rendered output instead of calling send(:component_instance) on a private method, per our ViewComponent testing guidance. Each leaf component now sets a distinguishing data-testid so the dispatcher spec can verify which one was rendered.
  • Converts describe blocks that described behavior/state (rather than a method) to context, per betterspecs guidance.
  • Drops the hardcoded :saas tag from duo_chat_disabled_non_admin_spec.rb, since DuoDisabledNonAdminComponent has no SaaS-specific branching, and documents why duo_ui_next must stay disabled for that empty state to be reachable.

The remaining two follow-up items from #596538 (closed) (renaming DuoChatHelper and fixing a gl-card CSS override) are handled in a separate MR since they are unrelated production changes.

References

Related to #596538 (closed)

Screenshots or screen recordings

N/A — test-only change, no UI impact.

How to set up and validate locally

  1. bundle exec rspec ee/spec/components/duo_chat_panel/
  2. bundle exec rspec ee/spec/features/duo_chat/duo_chat_disabled_non_admin_spec.rb
  3. bundle exec rubocop ee/app/components/duo_chat_panel/ ee/spec/components/duo_chat_panel/ ee/spec/features/duo_chat/duo_chat_disabled_non_admin_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading