Skip to content

Commit

Permalink
Fix expectation for meeting tab
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Dec 2, 2024
1 parent 00cf518 commit 928a7ab
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_grouped_agenda_items(direction)
def get_agenda_items_of_work_package(direction)
agenda_items = MeetingAgendaItem
.includes(:meeting)
.where(meeting_id: Meeting.visible(current_user))
.where(meeting_id: Meeting.not_templated.visible(current_user))
.where(work_package_id: @work_package.id)
.reorder(sort_clause(direction))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,10 @@

meetings_tab.fill_and_submit_meeting_dialog(
first_upcoming_meeting,
"A very important note added from the meetings tab to the first meeting!"
"A very important note added from the meetings tab to the first meeting!",
1
)

meetings_tab.expect_upcoming_counter_to_be(1)

page.within_test_selector("op-meeting-container-#{first_upcoming_meeting.id}") do
expect(page).to have_content("A very important note added from the meetings tab to the first meeting!")
end
Expand All @@ -354,11 +353,10 @@

meetings_tab.fill_and_submit_meeting_dialog(
second_upcoming_meeting,
"A very important note added from the meetings tab to the second meeting!"
"A very important note added from the meetings tab to the second meeting!",
2
)

meetings_tab.expect_upcoming_counter_to_be(2)

page.within_test_selector("op-meeting-container-#{second_upcoming_meeting.id}") do
expect(page).to have_content("A very important note added from the meetings tab to the second meeting!")
end
Expand All @@ -372,7 +370,8 @@

meetings_tab.fill_and_submit_meeting_dialog(
ongoing_meeting,
"Some notes to be added"
"Some notes to be added",
1
)

meetings_tab.expect_upcoming_counter_to_be(1)
Expand Down Expand Up @@ -408,11 +407,13 @@

meetings_tab.open_add_to_meeting_dialog

click_on("Save")
retry_block do
click_on("Save")

wait_for_network_idle
wait_for_network_idle

expect(page).to have_content("Meeting can't be blank")
raise "Expected error message to be shown" unless page.has_content?("Meeting can't be blank")
end
end

it "adds presenter when the work package is added to a meeting" do
Expand All @@ -423,7 +424,8 @@

meetings_tab.fill_and_submit_meeting_dialog(
first_upcoming_meeting,
"A very important note added from the meetings tab to the first meeting!"
"A very important note added from the meetings tab to the first meeting!",
1
)

meeting_page.visit!
Expand Down
10 changes: 8 additions & 2 deletions modules/meeting/spec/support/pages/work_package_meetings_tab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,19 @@ def open_add_to_meeting_dialog
page.find_test_selector("op-add-work-package-to-meeting-dialog-trigger").click
end

def fill_and_submit_meeting_dialog(meeting, notes)
def fill_and_submit_meeting_dialog(meeting, notes, counter)
fill_in("meeting_agenda_item_meeting_id", with: meeting.title)
expect(page).to have_css(".ng-option-marked", text: meeting.title) # wait for selection
page.find(".ng-option-marked").click
page.find(".ck-editor__editable").set(notes)

click_on("Save")
retry_block do
click_on("Save")

page.within_test_selector("op-upcoming-meetings-counter") do
raise "Expected counter to eq #{counter}" unless page.has_content?(counter)
end
end
end

private
Expand Down

0 comments on commit 928a7ab

Please sign in to comment.