Skip to content

Commit

Permalink
Disable cuprite in meeting flash spec (#16599)
Browse files Browse the repository at this point in the history
* Disable cuprite in meeting flash spec

* Clear previous flashes when not refreshing the page
  • Loading branch information
oliverguenther committed Sep 3, 2024
1 parent 3d13902 commit f00b6e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

RSpec.describe "Structured meetings CRUD",
:js,
:with_cuprite do
with_cuprite: false do
include Components::Autocompleter::NgSelectAutocompleteHelpers

shared_let(:project) { create(:project, enabled_module_names: %w[meetings work_package_tracking]) }
Expand Down Expand Up @@ -74,7 +74,7 @@
show_page.trigger_change_poll
expect(page).to have_css(flash_component, wait: 5)
expect(page).to have_text I18n.t(:notice_meeting_updated)
click_link_or_button "Reload"
page.within(".flash") { click_on "Reload" }
end

# Expect no notification in window2
Expand Down Expand Up @@ -103,7 +103,7 @@
expect(page).to have_css(flash_component, wait: 5)
expect(page).to have_text I18n.t(:notice_meeting_updated)

click_link_or_button "Reload"
page.within(".flash") { click_on "Reload" }

## Add section
show_page.add_section do
Expand All @@ -119,7 +119,7 @@
show_page.trigger_change_poll
expect(page).to have_css(flash_component, wait: 5)
expect(page).to have_text I18n.t(:notice_meeting_updated)
click_link_or_button "Reload"
page.within(".flash") { click_on "Reload" }
end

# Expect no notification in window2
Expand Down Expand Up @@ -147,7 +147,7 @@
show_page.trigger_change_poll
expect(page).to have_text I18n.t(:notice_meeting_updated)

click_link_or_button "Reload"
page.within(".flash") { click_on "Reload" }

## Close meeting
find_test_selector("close-meeting-button").click
Expand All @@ -158,7 +158,7 @@
show_page.trigger_change_poll
expect(page).to have_css(flash_component, wait: 5)
expect(page).to have_text I18n.t(:notice_meeting_updated)
click_link_or_button "Reload"
page.within(".flash") { click_on "Reload" }
end

# Expect no notification in window2
Expand Down
2 changes: 2 additions & 0 deletions modules/meeting/spec/support/pages/structured_meeting/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def trigger_dropdown_menu_item(name)

def trigger_change_poll
script = <<~JS
// Remove flashes from the page to prevent race conditions
document.querySelectorAll('.op-toast--wrapper').forEach((el) => el.remove());
var target = document.querySelector('[data-test-selector="meeting-page-header"]');
var controller = window.Stimulus.getControllerForElementAndIdentifier(target, 'poll-for-changes')
controller.triggerTurboStream();
Expand Down

0 comments on commit f00b6e9

Please sign in to comment.