Skip to content

Commit d418736

Browse files
committed
Fix broken tests for accept/reject proposal amendment buttons
1 parent 5061c32 commit d418736

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

decidim-proposals/spec/system/amendable/amend_proposal_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@
311311

312312
context "when the user clicks on the accept button" do
313313
before do
314+
# For some reason, the reject button click can fail unless the page
315+
# is first scrolled to the amend button...?
316+
# Got the idea from:
317+
# https://stackoverflow.com/a/39103252
318+
page.scroll_to(find(".card__amend-button"))
314319
click_link "Accept"
315320
end
316321

@@ -341,6 +346,11 @@
341346

342347
context "when the user clicks on the reject button" do
343348
before do
349+
# For some reason, the reject button click can fail unless the page
350+
# is first scrolled to the amend button...?
351+
# Got the idea from:
352+
# https://stackoverflow.com/a/39103252
353+
page.scroll_to(find(".card__amend-button"))
344354
click_link "Reject"
345355
end
346356

@@ -349,7 +359,7 @@
349359
end
350360

351361
it "is changed the state of the emendation" do
352-
expect(page).to have_css(".alert", text: "This amendment for the proposal #{proposal.title} was rejected")
362+
expect(page).to have_css(".callout.alert", text: "This amendment for the proposal #{proposal.title} was rejected")
353363
end
354364
end
355365
end

0 commit comments

Comments
 (0)