From 072e48a338f17a24913c06624ad60f48fa214f10 Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Sat, 17 Oct 2026 08:56:08 +0800 Subject: [PATCH] docs: keep frontend agent guidance within size budget (#6999) --- frontend/AGENTS.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/AGENTS.md b/frontend/AGENTS.md index defa3d0254..271b52e2f3 100644 --- a/frontend/AGENTS.md +++ b/frontend/AGENTS.md @@ -42,7 +42,12 @@ Webpack is the default development bundler. Use `DEER_FLOW_DEV_BUNDLER=turbo` wi On Windows `pnpm dev` binds `127.0.0.1` by default because Hyper-V/winnat excluded port ranges can reject Next's default `0.0.0.0` bind with `EACCES` (#2870). Pass `pnpm dev -- --hostname 0.0.0.0` to listen on a LAN interface instead. -Rstest runs them as two projects (`rstest.config.ts`). `*.test.ts` / `*.test.tsx` run in a plain **node** environment — that is nearly the whole suite, and it is the default for anything that is pure logic. `*.dom.test.ts` / `*.dom.test.tsx` run in **happy-dom**, for tests that need a document: hooks driven through `renderHook` from `@testing-library/react`, and components. Keep the split — a DOM environment costs roughly 3x the runtime of the node suite, so tests that do not render should not opt into it. A hook whose behavior only exists under real React (effect ordering, cleanup on unmount, re-render on store change) belongs in a `.dom.test.*` file rather than a node test that mocks `react` itself. +`rstest.config.ts` separates **node** (`*.test.ts` / `*.test.tsx`) for pure logic +from **happy-dom** (`*.dom.test.ts` / `*.dom.test.tsx`) for components and hooks +rendered with `@testing-library/react`'s `renderHook`. Keep the split: DOM tests +cost roughly 3x more runtime. Hooks that depend on React effect ordering, unmount +cleanup, or re-renders on store changes belong in `.dom.test.*`; do not mock React +in node tests to cover those behaviors. E2E tests live under `tests/e2e/` and use Playwright with Chromium. They mock all backend APIs via `page.route()` network interception and test real page interactions (navigation, chat input, streaming responses). Config: `playwright.config.ts`. The real-backend auth contract in `tests/e2e-real-backend/auth-disabled-contract.spec.ts` and `backend/tests/test_auth_me_permissions.py` pin the complete route-permission list; update both when adding registered permissions (including `projects:read/write/delete`).