Skip to content

Extract breadcrumb related specs to their own tests#15737

Merged
andreslucena merged 26 commits intodevelopfrom
chore/split-tests
Dec 13, 2025
Merged

Extract breadcrumb related specs to their own tests#15737
andreslucena merged 26 commits intodevelopfrom
chore/split-tests

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu commented Dec 4, 2025

🎩 What? Why?

This PR splits the specs for breadcrumbs in their own spec. It is related to #15683 and #15299

  • Extract specs, don't piggyback other examples.
  • Add spec for breadcrumb on amendmend proposal
  • Last item of the breadcrumb in Budgets is missing

📌 Related Issues

Link your PR to an issue

Testing

  1. Green pipeline
  2. Visit budget components, disable voting, see the breadcrumb is set.
  3. Visit proposals components, check single proposal, check amendment to check the values in breadcrumbs.

📷 Screenshots

Please add screenshots of the changes you are proposing
Description

♥️ Thank you!

github-actions[bot]
github-actions bot previously approved these changes Dec 4, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 5, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 5, 2025
@alecslupu alecslupu marked this pull request as ready for review December 5, 2025 07:37
Copilot AI review requested due to automatic review settings December 5, 2025 07:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors breadcrumb-related test assertions across multiple Decidim modules by extracting them into dedicated test cases, and adds new breadcrumb specifications for proposals and budgets. Additionally, it implements breadcrumb support for budget projects and amendments, and adds locale parameters to meeting breadcrumb URLs.

Key Changes

  • Extracted breadcrumb assertions from existing tests into separate, focused test cases across 14 spec files
  • Added comprehensive breadcrumb tests for proposals (including amendments) and budgets in new dedicated spec files
  • Implemented breadcrumb methods in budgets and proposals controllers to support hierarchical navigation

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
decidim-proposals/spec/system/proposals_breadcrumbs_spec.rb New file with comprehensive breadcrumb tests for proposals index, single proposal, and amendment pages
decidim-budgets/spec/system/budgets_breadcrumbs_spec.rb New file with breadcrumb tests for budgets index, budget detail, and project detail pages
decidim-proposals/app/controllers/decidim/proposals/proposals_controller.rb Refactored breadcrumb methods to support parent and child breadcrumb items for amendments
decidim-budgets/app/controllers/decidim/budgets/projects_controller.rb Added breadcrumb methods to display budget and project hierarchy
decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb Added locale parameter to breadcrumb URL for consistency
decidim-meetings/app/controllers/decidim/meetings/versions_controller.rb Added locale parameter to breadcrumb URL for consistency
decidim-surveys/spec/system/survey_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-proposals/spec/system/proposals_versions_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-proposals/spec/system/proposals_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-proposals/spec/system/proposal_show_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-meetings/spec/system/show_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-meetings/spec/system/explore_versions_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-meetings/spec/system/explore_meetings_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-elections/spec/system/user_votes_in_an_election_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-debates/spec/system/show_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-debates/spec/system/debates_versions_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-collaborative_texts/spec/system/user_sends_suggestions_spec.rb Refactored breadcrumb assertions into consolidated test case
decidim-blogs/spec/system/explore_posts_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-accountability/spec/system/explore_versions_spec.rb Extracted breadcrumb assertions into dedicated test cases
decidim-accountability/spec/system/explore_results_spec.rb Extracted breadcrumb assertions into dedicated test cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
alecslupu and others added 2 commits December 5, 2025 14:38
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2025
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from what I found, other things to check:

Consistency in the plural of the files:

$ fd breadcrumb_spec
decidim-assemblies/spec/system/assembly_breadcrumb_spec.rb
decidim-conferences/spec/system/conference_breadcrumb_spec.rb
decidim-initiatives/spec/system/initiative_breadcrumb_spec.rb
decidim-participatory_processes/spec/system/participatory_process_breadcrumb_spec.rb

$ fd breadcrumbs_spec
decidim-accountability/spec/system/results_breadcrumbs_spec.rb
decidim-blogs/spec/system/blog_breadcrumbs_spec.rb
decidim-budgets/spec/system/budgets_breadcrumbs_spec.rb
decidim-collaborative_texts/spec/system/collaborative_tests_breadcrumbs_spec.rb
decidim-debates/spec/system/debates_breadcrumbs_spec.rb
decidim-elections/spec/system/election_breadcrumbs_spec.rb
decidim-meetings/spec/system/meeting_breadcrumbs_spec.rb
decidim-proposals/spec/system/proposals_breadcrumbs_spec.rb
decidim-surveys/spec/system/survey_breadcrumbs_spec.rb

Please do check the consistency in the title of the specs - it should always be the same: "Blogs Breadcrumb", not "Blogs breadcrumbs".

Also please check the variables that you're passing to the specs. I noticed that there are multiple that aren't actually being used in the examples.

github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2025
github-actions[bot]
github-actions bot previously approved these changes Dec 12, 2025
@alecslupu
Copy link
Copy Markdown
Contributor Author

Apart from what I found, other things to check:

Consistency in the plural of the files:

$ fd breadcrumb_spec
decidim-assemblies/spec/system/assembly_breadcrumb_spec.rb
decidim-conferences/spec/system/conference_breadcrumb_spec.rb
decidim-initiatives/spec/system/initiative_breadcrumb_spec.rb
decidim-participatory_processes/spec/system/participatory_process_breadcrumb_spec.rb

$ fd breadcrumbs_spec
decidim-accountability/spec/system/results_breadcrumbs_spec.rb
decidim-blogs/spec/system/blog_breadcrumbs_spec.rb
decidim-budgets/spec/system/budgets_breadcrumbs_spec.rb
decidim-collaborative_texts/spec/system/collaborative_tests_breadcrumbs_spec.rb
decidim-debates/spec/system/debates_breadcrumbs_spec.rb
decidim-elections/spec/system/election_breadcrumbs_spec.rb
decidim-meetings/spec/system/meeting_breadcrumbs_spec.rb
decidim-proposals/spec/system/proposals_breadcrumbs_spec.rb
decidim-surveys/spec/system/survey_breadcrumbs_spec.rb

Please do check the consistency in the title of the specs - it should always be the same: "Blogs Breadcrumb", not "Blogs breadcrumbs".

Also please check the variables that you're passing to the specs. I noticed that there are multiple that aren't actually being used in the examples.

This should be ready. TI have extracted the breadcrumbs to their own separate spec files. The convention that i have tried on the files is : "module_name_breadscrumbs_spec.rb" , while the example names follow the convention "Namespace Breadcrumb".

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much cleaner!

@andreslucena andreslucena merged commit cb5212d into develop Dec 13, 2025
58 checks passed
@andreslucena andreslucena deleted the chore/split-tests branch December 13, 2025 07:23
alecslupu added a commit to i-need-another-coffee/decidim-api that referenced this pull request Dec 14, 2025
* Extract each one spec in own test

* Fix budgets specs

* Add propsoals specs

* Fix failing specs

* Update decidim-proposals/spec/system/proposals_breadcrumbs_spec.rb

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update decidim-accountability/spec/system/explore_versions_spec.rb

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Extract results

* Extract surveys specs

* Extract surveys specs part 2

* Fully extract proposals

* Fully extract proposals

* Fix typo

* Extract meeetings

* Extract elections

* Extract debates

* Extract collaborative texts

* Extract blogs

* Create uniform specs

* Fix filename

* Apply review recommendations

* Standardize tests

* Fix specs

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants