-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[#70336] Sections in meeting agenda not displayed correctly when moved #21595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -513,5 +513,43 @@ | |
| show_page.expect_blankslate | ||
| end | ||
| end | ||
|
|
||
| it "maintains section order when rendering" do | ||
| section1 = create(:meeting_section, meeting:, title: "Section A") | ||
| section2 = create(:meeting_section, meeting:, title: "Section B") | ||
| section3 = create(:meeting_section, meeting:, title: "Section C") | ||
|
|
||
| show_page.visit! | ||
| show_page.expect_section(title: "Section A") | ||
| show_page.expect_section(title: "Section B") | ||
| show_page.expect_section(title: "Section C") | ||
|
|
||
| initial_positions = [section1, section2, section3].map(&:position) | ||
| expect(initial_positions).to eq([1, 2, 3]) | ||
|
|
||
| show_page.select_section_action(section3, "Move up") | ||
|
|
||
| wait_for_network_idle | ||
|
|
||
| expect([section1, section2, section3].map { |s| s.reload.position }).to eq([1, 3, 2]) | ||
|
|
||
| sections = page.all(".op-meeting-section-container").select do |section| | ||
| section["data-test-selector"]&.start_with?("meeting-section-container-") && | ||
| !section["data-test-selector"]&.include?("header") | ||
| end | ||
|
||
| expect(sections[0]).to have_content("Section A") | ||
| expect(sections[1]).to have_content("Section C") | ||
| expect(sections[2]).to have_content("Section B") | ||
|
|
||
| show_page.visit! | ||
|
|
||
| sections_after_refresh = page.all(".op-meeting-section-container").select do |section| | ||
| section["data-test-selector"]&.start_with?("meeting-section-container-") && | ||
| !section["data-test-selector"]&.include?("header") | ||
| end | ||
| expect(sections_after_refresh[0]).to have_content("Section A") | ||
| expect(sections_after_refresh[1]).to have_content("Section C") | ||
| expect(sections_after_refresh[2]).to have_content("Section B") | ||
| end | ||
| end | ||
| end | ||
Uh oh!
There was an error while loading. Please reload this page.