From 2f667a6225f1dcccc556c0dc1f1c269264b68987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 26 Feb 2025 12:38:57 +0100 Subject: [PATCH] Add missing expectation to annotations test This expectations in this test were true both before and after clicking on the `.icon-expand` link, so it was possible that the test finished before the request generated by that click did. So we're adding an extra expectation to make sure we're testing what we want to test: the content of the page after the request has finished. --- spec/system/comments/legislation_annotations_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/system/comments/legislation_annotations_spec.rb b/spec/system/comments/legislation_annotations_spec.rb index 22d169430..6fbab0f7a 100644 --- a/spec/system/comments/legislation_annotations_spec.rb +++ b/spec/system/comments/legislation_annotations_spec.rb @@ -39,9 +39,10 @@ describe "Commenting legislation annotations" do find(".icon-expand").click end - expect(page).to have_css(".comment", count: 2) - expect(page).to have_content("my annotation") - expect(page).to have_content("my other annotation") + expect(page).to have_content "Comments about" + expect(page).to have_css ".comment", count: 2 + expect(page).to have_content "my annotation" + expect(page).to have_content "my other annotation" end scenario "Reply on a single annotation thread and display it in the merged annotation thread" do