Skip to content

Fix alerts feature specs to work with the super sidebar

Paul Gascou-Vaillancourt requested to merge 420121-fix-alert-specs into master

What does this MR do and why?

This updates alerts feature specs to pass when the super sidebar is enabled.

Also fixes a bug where the right sidebar would be partially hidden on page load due to the breadcrumbs not taking it into account.

Screenshots or screen recordings

Before After
Screenshot_2023-11-01_at_7.29.24_AM Screenshot_2023-11-01_at_7.27.50_AM

How to set up and validate locally

bundle exec rspec spec/features/alert_management/alert_details_spec.rb
bundle exec rspec spec/features/alert_management/alert_management_list_spec.rb

To verify the bug fix, visit an alert's details page if you have the feature set up. Otherwise, this can be verified via the feature spec itself:

  1. Add binding.pry to a test case:
    diff --git a/spec/features/alert_management/alert_details_spec.rb b/spec/features/alert_management/alert_details_spec.rb
    index 7fa9bccbecef..e51985b02b0e 100644
    --- a/spec/features/alert_management/alert_details_spec.rb
    +++ b/spec/features/alert_management/alert_details_spec.rb
    @@ -46,6 +46,7 @@
         end
     
         it 'updates the alert todo button from the right sidebar' do
    +      binding.pry
           expect(page).to have_selector('[data-testid="alert-todo-button"]')
           todo_button = find('[data-testid="alert-todo-button"]')
     
  2. Run the spec in headful mode:
    WEBDRIVER_HEADLESS=0 bundle exec spring rspec spec/features/alert_management/alert_details_spec.rb:48

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #420121 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports