diff --git a/spec/components/admin/stats/sdg_component_spec.rb b/spec/components/admin/stats/sdg_component_spec.rb
new file mode 100644
index 000000000..2f222b44f
--- /dev/null
+++ b/spec/components/admin/stats/sdg_component_spec.rb
@@ -0,0 +1,11 @@
+require "rails_helper"
+
+describe Admin::Stats::SDGComponent do
+ include Rails.application.routes.url_helpers
+
+ it "renders a links to go back to the admin stats index" do
+ render_inline Admin::Stats::SDGComponent.new(SDG::Goal.all)
+
+ expect(page).to have_link "Go back", href: admin_stats_path
+ end
+end
diff --git a/spec/system/admin/stats_spec.rb b/spec/system/admin/stats_spec.rb
index fe6103b75..9ac12611c 100644
--- a/spec/system/admin/stats_spec.rb
+++ b/spec/system/admin/stats_spec.rb
@@ -183,6 +183,8 @@ describe "Stats", :admin do
visit admin_stats_path
click_link "Proposal notifications"
+ expect(page).to have_link "Go back", href: admin_stats_path
+
within("#proposal_notifications_count") do
expect(page).to have_content "3"
end
@@ -232,6 +234,8 @@ describe "Stats", :admin do
visit admin_stats_path
click_link "Direct messages"
+ expect(page).to have_link "Go back", href: admin_stats_path
+
within("#direct_messages_count") do
expect(page).to have_content "3"
end
@@ -253,6 +257,8 @@ describe "Stats", :admin do
click_link "Polls"
end
+ expect(page).to have_link "Go back", href: admin_stats_path
+
within("#web_participants") do
expect(page).to have_content "3"
end