Skip to content

refactor: update frontend and testing guidelines #34499

Merged
nicobytes merged 2 commits intomainfrom
32713-cursor-testing-rules
Feb 5, 2026
Merged

refactor: update frontend and testing guidelines #34499
nicobytes merged 2 commits intomainfrom
32713-cursor-testing-rules

Conversation

@nicobytes
Copy link
Contributor

@nicobytes nicobytes commented Feb 4, 2026

This pull request updates the frontend documentation and meta-rules to standardize and enforce the use of @dotcms/utils-testing createFake 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:

  • Updated all relevant documentation to require using @dotcms/utils-testing createFake 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]
  • Updated context and rule files to reflect the new mocking standard and reinforce using createFake functions in all test-related guidance.

Styling Standards:

  • Updated styling guidelines to prioritize PrimeFlex utility classes and PrimeNG components for layout and UI, with BEM and custom SCSS reserved only for cases where utilities/components do not suffice. Clarified avoidance of hardcoded colors/spacing and use of design tokens or theme variables. [1] [2]

Documentation Cleanup:

  • Removed a redundant frontend documentation index entry.

#32713

This PR fixes: #32713

… 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.
Copy link
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 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.md in favor of docs/frontend/TESTING_FRONTEND.md as the canonical frontend testing guide.
  • Updated docs/frontend/TESTING_FRONTEND.md, .github/instructions/frontend.instructions.md, and Cursor rule files to require @dotcms/utils-testing createFake* 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.

@nicobytes nicobytes enabled auto-merge February 5, 2026 00:05
@nicobytes nicobytes added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit f7f888c Feb 5, 2026
18 checks passed
@nicobytes nicobytes deleted the 32713-cursor-testing-rules branch February 5, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[EPIC] Improve times on CI/CD and Code Quality

3 participants