|
524 | 524 | show_page.expect_section(title: "Section B") |
525 | 525 | show_page.expect_section(title: "Section C") |
526 | 526 |
|
527 | | - initial_positions = [section1, section2, section3].map(&:position) |
528 | | - expect(initial_positions).to eq([1, 2, 3]) |
529 | | - |
530 | 527 | show_page.select_section_action(section3, "Move up") |
531 | 528 |
|
532 | 529 | wait_for_network_idle |
533 | 530 |
|
534 | 531 | expect([section1, section2, section3].map { |s| s.reload.position }).to eq([1, 3, 2]) |
535 | 532 |
|
536 | | - sections = page.all(".op-meeting-section-container").select do |section| |
537 | | - section["data-test-selector"]&.start_with?("meeting-section-container-") && |
538 | | - !section["data-test-selector"]&.include?("header") |
539 | | - end |
540 | | - expect(sections[0]).to have_content("Section A") |
541 | | - expect(sections[1]).to have_content("Section C") |
542 | | - expect(sections[2]).to have_content("Section B") |
| 533 | + expect(show_page.section_headers) |
| 534 | + .to eq(["Section A", "Section C", "Section B"]) |
543 | 535 |
|
544 | | - show_page.visit! |
| 536 | + show_page.reload! |
545 | 537 |
|
546 | | - sections_after_refresh = page.all(".op-meeting-section-container").select do |section| |
547 | | - section["data-test-selector"]&.start_with?("meeting-section-container-") && |
548 | | - !section["data-test-selector"]&.include?("header") |
549 | | - end |
550 | | - expect(sections_after_refresh[0]).to have_content("Section A") |
551 | | - expect(sections_after_refresh[1]).to have_content("Section C") |
552 | | - expect(sections_after_refresh[2]).to have_content("Section B") |
| 538 | + expect(show_page.section_headers) |
| 539 | + .to eq(["Section A", "Section C", "Section B"]) |
553 | 540 | end |
554 | 541 | end |
555 | 542 | end |
0 commit comments