Skip to content

docs(frontend): add testing guide and refresh README#5170

Merged
Yicong-Huang merged 12 commits into
apache:mainfrom
Yicong-Huang:docs/frontend-testing-guide
May 24, 2026
Merged

docs(frontend): add testing guide and refresh README#5170
Yicong-Huang merged 12 commits into
apache:mainfrom
Yicong-Huang:docs/frontend-testing-guide

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang commented May 23, 2026

What changes were proposed in this PR?

Three docs at the root of frontend/:

  • README.md — replaces the default Angular-CLI stub. Quickstart with stack, setup, common commands, a short Testing section, and the project layout.
  • TESTING.md — canonical testing reference for humans and agents. Stack, the fixture.detectChanges() mental model, recipes, jsdom-vs-browser-mode decision, anti-patterns, and coverage troubleshooting.
  • AGENTS.md — scoped agent rules. Placement rules for new files, frontend conventions, the testing checklist that fronts TESTING.md, and deeper pointers.

The three are deduplicated: README is the source of truth for stack / commands / layout; AGENTS.md points back to it; TESTING.md holds the testing depth.

Any related issues, documentation, discussions?

Closes #5169. Captures the conventions in use today (async () => in beforeEach, standalone components in imports:, vi.fn() mocks, the two-target jsdom / browser-mode split from #5017).

How was this PR tested?

Documentation-only. prettier --check passes on all three files. Inline code samples come from existing specs (mini-map.component.spec.ts, workspace.component.spec.ts, workflow-editor.component.spec.ts); the helpers and configs they reference all exist on main.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

Three files at frontend/ root:

- AGENTS.md  scoped, auto-loaded agent rules: Vitest stack, three golden
  rules, minimum-viable spec template, anti-patterns red list,
  jsdom-vs-browser-mode decision.
- TESTING.md  canonical human-readable guide: stack overview, why
  detectChanges() drives template coverage, recipes, standalone-component
  patterns, mocking, anti-patterns, coverage troubleshooting, and a
  Karma to Vitest migration cheatsheet.
- README.md  replaces the stale ng-new stub; points testing-related
  questions to TESTING.md and AGENTS.md.

Closes apache#5169
@github-actions github-actions Bot added frontend Changes related to the frontend GUI docs Changes related to documentations labels May 23, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.65%. Comparing base (d1cf4eb) to head (0387df8).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5170      +/-   ##
============================================
+ Coverage     43.43%   43.65%   +0.21%     
  Complexity     2216     2216              
============================================
  Files          1049     1049              
  Lines         40575    40580       +5     
  Branches       4321     4324       +3     
============================================
+ Hits          17625    17715      +90     
+ Misses        21855    21766      -89     
- Partials       1095     1099       +4     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 09d5cfc
agent-service 33.76% <ø> (ø) Carriedforward from 09d5cfc
amber 43.92% <ø> (ø) Carriedforward from 09d5cfc
computing-unit-managing-service 1.38% <ø> (ø) Carriedforward from 09d5cfc
config-service 19.35% <ø> (ø) Carriedforward from 09d5cfc
file-service 32.18% <ø> (ø) Carriedforward from 09d5cfc
frontend 35.15% <ø> (+0.53%) ⬆️
python 90.50% <ø> (ø) Carriedforward from 09d5cfc
workflow-compiling-service 58.39% <ø> (ø) Carriedforward from 09d5cfc

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Two changes across all three frontend docs:

- Single-line paragraphs and list items so GitHub renders consistent
  flowing prose; intra-paragraph hard wraps removed.
- Scoped down to the current stack: drop migration-cheatsheet section
  and spy-rewriting anti-pattern. The remaining content describes
  Vitest patterns directly without contrasting against a previous
  setup.
Specific Angular / Vitest / Node / Yarn version numbers rot quickly and
disagree with whatever is actually pinned in `package.json` and
`engines`. Replace them with version-free framework names. Readers who
need the exact version look at `package.json`.
…humans and agents

The previous wording positioned TESTING.md as the human-facing
counterpart to AGENTS.md. In practice both audiences read it: humans
during onboarding and PR review, agents on demand whenever AGENTS.md's
rules need a deeper recipe or troubleshooting context. Update the
opening lines of AGENTS.md / TESTING.md and the README pointer to say
so explicitly.
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

Adds and refreshes frontend-facing documentation to capture the current Angular + Vitest testing stack/conventions and replace the stale Angular CLI stub README for contributors working in frontend/.

Changes:

  • Add frontend/TESTING.md as the canonical frontend unit-testing guide (Vitest stack, recipes, jsdom vs browser-mode decision, coverage troubleshooting).
  • Add frontend/AGENTS.md as scoped, auto-loading AI agent rules for the frontend/ subtree, pointing to TESTING.md for depth.
  • Refresh frontend/README.md with project-specific setup/commands/layout and links to the new docs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
frontend/TESTING.md New canonical testing guide describing the current Vitest/jsdom + Playwright browser-mode setup and common testing recipes.
frontend/AGENTS.md New scoped agent instructions for frontend work, summarizing rules and pointing to TESTING.md.
frontend/README.md Replaces Angular CLI stub with Texera UI-specific commands, layout, and doc pointers.

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

Comment thread frontend/AGENTS.md Outdated
…ointers

AGENTS.md was duplicating most of TESTING.md (minimum-viable spec
template, anti-pattern table, browser-mode decision). That content
belongs in TESTING.md once and is reached on demand. Trim the testing
section to the three rules an agent should keep in working memory plus
a hard pointer to TESTING.md.

In exchange, add the content that actually belongs in a scoped agent
context for `frontend/`:

- a layout table framed as "if you're touching X, look in Y", including
  the generated and vendored files that should never be hand-edited;
- placement rules (features colocate their components/services/types,
  Stub…Service siblings live next to the real service);
- expanded pointers — repo-wide testing philosophy, PR conventions,
  architecture map, coverage dashboard, browser-mode rationale PR.
Treat README.md as the source of truth for the stack, prerequisites,
commands, project layout, and the basic doc pointers — those render on
the GitHub folder page and are read by every human visitor.

AGENTS.md now carries only what README does not: placement rules for
new files (including the "do not hand-edit" codegen / vendored list),
agent-relevant conventions (standalone, formatter, stub reuse), the
testing checklist that fronts TESTING.md, and pointers that go deeper
than the README's surface entries (named ../AGENTS.md sections, the
coverage dashboard, and the browser-mode setup PR).
…NG.md only

Two pointers do the job: the testing reference itself and the
repo-wide testing philosophy. Drop the AGENTS.md / CONTRIBUTING.md /
parent AGENTS.md bullets — the first auto-loads for agents, the
others are one folder up and surface through the root docs.
…ad next"

A `## Testing` section between Common commands and Project layout is
the natural home for the TDD pointer and the link to TESTING.md.
Restore the original "Where to read next" bullets for AGENTS.md, the
repo-wide CONTRIBUTING.md, and the repo-wide AGENTS.md.
The Testing section now carries the only outbound pointers that
really belong in a frontend quickstart. AGENTS.md auto-loads for
agents; ../CONTRIBUTING.md and ../AGENTS.md surface naturally one
folder up. Also update AGENTS.md's stale references to the dropped
section.
…section

"Tests come first" is the TL;DR; readers who want the workflow follow
TESTING.md from here, which already links the repo-wide guidance.
Copy link
Copy Markdown
Contributor

@mengw15 mengw15 left a comment

Choose a reason for hiding this comment

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

LGTM, left a comment

Comment thread frontend/TESTING.md Outdated
The line cited specific line counts and a coverage percentage that
will drift as the spec evolves. Other recipes already point at the
same file from a stable angle.
Prettier wants a blank line between the closing code fence and the
next subsection heading; the previous edit removed the surrounding
context together with the deleted line.
@Yicong-Huang Yicong-Huang enabled auto-merge May 24, 2026 08:28
@Yicong-Huang Yicong-Huang added this pull request to the merge queue May 24, 2026
Merged via the queue into apache:main with commit e7e5d4e May 24, 2026
16 checks passed
@Yicong-Huang Yicong-Huang deleted the docs/frontend-testing-guide branch May 24, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Changes related to documentations frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a frontend testing guide and refresh frontend README

5 participants