Skip to content

Commit

Permalink
Fix meetings tests
Browse files Browse the repository at this point in the history
  • Loading branch information
laurajaime committed Jun 29, 2023
1 parent f1553f3 commit 38e78c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
# using admin to avoid supervisor permissions checking
let(:user) { create :user, :admin, :confirmed, organization: organization }
let(:scoped_participatory_process) { create(:participatory_process, :with_steps, organization: organization, scope: scope) }
let!(:first_meeting) { create(:meeting, component: component, scope: scope, start_time: Time.zone.parse("2021-04-26T11:00:00")) }
let!(:second_meeting) { create(:meeting, component: component, scope: scope, start_time: Time.zone.parse("2021-04-28T11:00:00")) }
let!(:first_meeting) { create(:meeting, :published, component: component, scope: scope, start_time: Time.zone.parse("2023-07-26 11:00:00")) }
let!(:second_meeting) { create(:meeting, :published, component: component, scope: scope, start_time: Time.zone.parse("2023-07-28 11:00:00")) }

describe "when cards visualization is uncheck" do
let!(:scope2) { create :scope, organization: participatory_process.organization }

before do
allow(Time).to receive(:now).and_return(Time.zone.parse("2023-07-15 13:30"))

component.settings = { enable_cards_visualization: false }
component.save!
sign_in user
Expand Down
12 changes: 6 additions & 6 deletions spec/system/decidim/meetings/explore_meetings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
sign_in user
visit_component

within ".hour_check_boxes_tree_filter" do
within ".with_hour_check_boxes_tree_filter" do
check "Before 13am"
end

expect(page).to have_css(".card--meeting", count: 1)
expect(page).to have_content(translated(in_hour_meeting.title))

within ".hour_check_boxes_tree_filter" do
within ".with_hour_check_boxes_tree_filter" do
uncheck "Before 13am"
end

Expand All @@ -52,7 +52,7 @@
sign_in user
visit_component

within ".day_days_select_filter" do
within ".with_day_days_select_filter" do
find("option[value='monday']").click
end

Expand All @@ -70,14 +70,14 @@
sign_in user
visit_component

within ".hour_check_boxes_tree_filter" do
within ".with_hour_check_boxes_tree_filter" do
check("Before 13am", allow_label_click: true)
end

expect(page).to have_css(".meeting-list li", count: 1)
expect(page).to have_content(translated(in_hour_meeting.title))

within ".hour_check_boxes_tree_filter" do
within ".with_hour_check_boxes_tree_filter" do
uncheck("Before 13am", allow_label_click: true)
end

Expand All @@ -92,7 +92,7 @@
sign_in user
visit_component

within ".day_days_select_filter" do
within ".with_day_days_select_filter" do
find("option[value='monday']").click
end

Expand Down

0 comments on commit 38e78c7

Please sign in to comment.