refactor: update frontend and testing guidelines #34499
Merged
Conversation
… classes and mocking practices - Updated frontend-context.mdc to prioritize PrimeFlex utility classes and PrimeNG components over custom SCSS. - Enhanced testing guidelines in test-context.mdc to mandate the use of @dotcms/utils-testing createFake functions for domain mocks, discouraging manual mocks. - Revised frontend instructions to reflect the new styling priorities and mocking standards. - Removed outdated FRONTEND_UNIT_TESTS.md documentation to streamline testing resources.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates frontend testing and styling documentation, along with AI/context rules, to standardize how mocks and styles are used in the Angular monorepo. It deprecates an older, redundant frontend unit testing doc in favor of a single, richer testing guide and aligns Cursor/CI instructions with that guide.
Changes:
- Removed the legacy
docs/testing/FRONTEND_UNIT_TESTS.mdin favor ofdocs/frontend/TESTING_FRONTEND.mdas the canonical frontend testing guide. - Updated
docs/frontend/TESTING_FRONTEND.md,.github/instructions/frontend.instructions.md, and Cursor rule files to require@dotcms/utils-testingcreateFake*functions for domain object mocks and to clarify mocking patterns. - Tightened styling guidance in frontend instructions and context rules to prioritize PrimeFlex/PrimeNG and treat custom SCSS/BEM as an exception, plus minor cleanup to the Angular docs index.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
docs/testing/FRONTEND_UNIT_TESTS.md |
Fully removed now-redundant frontend unit testing guide in favor of the centralized TESTING_FRONTEND.md documentation. |
docs/frontend/TESTING_FRONTEND.md |
Expanded with a required createFake* usage section, a reference table of fake creators, explicit “no manual domain mocks” rules, and updated best-practices/location info (with one outdated path noted below). |
docs/frontend/ANGULAR_STANDARDS.md |
Cleaned up the “See also” index by removing a redundant README entry, keeping the Angular standards index lean. |
.github/instructions/frontend.instructions.md |
Updated the high-level frontend instructions to strongly prefer PrimeFlex/PrimeNG for styling and to mandate @dotcms/utils-testing createFake* functions for domain mocks in tests. |
.cursor/rules/test-context.mdc |
Adjusted test context rules so Cursor explicitly nudges towards createFake* mocks over manual domain object construction. |
.cursor/rules/frontend-context.mdc |
Synced frontend context rules with the new styling and mocking standards, ensuring agents prefer PrimeFlex/PrimeNG and @dotcms/utils-testing in generated code/tests. |
erickgonzalez
approved these changes
Feb 4, 2026
oidacra
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the frontend documentation and meta-rules to standardize and enforce the use of
@dotcms/utils-testingcreateFake functions for domain object mocks in tests, and to clarify styling best practices. The changes emphasize avoiding manual mocks for domain objects and prioritizing PrimeFlex/PrimeNG for styling, with BEM/custom SCSS as a fallback.Testing Standards and Mock Data:
@dotcms/utils-testingcreateFake functions (e.g.,createFakeContentlet,createFakeLanguage) for domain object mocks in tests, and to explicitly prohibit manual mocks for these objects. Provided a comprehensive reference table of available createFake functions and example usage. [1] [2] [3] [4] [5] [6] [7]Styling Standards:
Documentation Cleanup:
#32713
This PR fixes: #32713