From f9cf5b8dfdb2b9ef3bf7067a4120b2d2b5fcc5fd Mon Sep 17 00:00:00 2001 From: Eric Elliott Date: Mon, 12 Jan 2026 17:41:11 -0800 Subject: [PATCH 1/2] Enhance TDD documentation with UI testing strategy Added UI testing strategy guidelines and constraints. --- ai/rules/tdd.mdc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ai/rules/tdd.mdc b/ai/rules/tdd.mdc index f1ce134..a5017ef 100644 --- a/ai/rules/tdd.mdc +++ b/ai/rules/tdd.mdc @@ -63,6 +63,12 @@ For Vitest/Riteway tests: - Module mocking: vi.mock with vi.importActual for partial mocks - Works cleanly with ESM. Avoid require. - Timers: vi.useFakeTimers and vi.setSystemTime +- UI testing strategy: + - Redux actions/selectors: Pure tests (no component rendering needed) + - Side effects: must be UI isolated, see `javascript/javascript-io-network-effects.mdc` + - Component rendering: Use riteway/render for markup verification + - Browser interactions: Use Playwright to exercise real browser APIs + - Never use @testing-library/react (redundant with above patterns) Constraints { Unless directed otherwise, always colocate tests with the code they are testing. @@ -78,4 +84,4 @@ State { libraryStack // e.g. React + Redux + Redux Saga } -/welcome \ No newline at end of file +/welcome From 1c92986866f84d60aafe7e4a984ddac88676bb0f Mon Sep 17 00:00:00 2001 From: Eric Elliott Date: Mon, 12 Jan 2026 18:11:36 -0800 Subject: [PATCH 2/2] Update ai/rules/tdd.mdc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ai/rules/tdd.mdc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ai/rules/tdd.mdc b/ai/rules/tdd.mdc index a5017ef..67777cb 100644 --- a/ai/rules/tdd.mdc +++ b/ai/rules/tdd.mdc @@ -63,9 +63,9 @@ For Vitest/Riteway tests: - Module mocking: vi.mock with vi.importActual for partial mocks - Works cleanly with ESM. Avoid require. - Timers: vi.useFakeTimers and vi.setSystemTime -- UI testing strategy: + - UI testing strategy: - Redux actions/selectors: Pure tests (no component rendering needed) - - Side effects: must be UI isolated, see `javascript/javascript-io-network-effects.mdc` + - Side effects: must be isolated from UI, see `javascript/javascript-io-network-effects.mdc` - Component rendering: Use riteway/render for markup verification - Browser interactions: Use Playwright to exercise real browser APIs - Never use @testing-library/react (redundant with above patterns)