一键导入
integration-testing
Guidelines for cross-layer testing (Hooks + UI + Services) using real logic and MSW for network interception.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guidelines for cross-layer testing (Hooks + UI + Services) using real logic and MSW for network interception.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Mandatory rule requiring a corresponding test file for every business logic file and UI component.
Guidelines for frontend component and E2E testing in FinanzApp.
Component organization and modern React principles for the FrontEnd.
Catalog of all specialized skills used across the FinanzApp project (Frontend & Backend).
Reglas obligatorias para garantizar la accesibilidad web (A11y) en FinanzApp. Sigue estándares WCAG 2.1 para usuarios con discapacidad visual y navegación por teclado.
Guidelines for end-to-end testing in FinanzApp using Playwright.
| name | integration-testing |
| description | Guidelines for cross-layer testing (Hooks + UI + Services) using real logic and MSW for network interception. |
This skill defines how to implement and organize integration tests that validate the interaction between services, custom hooks, and UI components.
Unlike unit tests that mock functions, integration tests in FinanzApp use:
src/services/ are executed.src/hooks/ manage the actual state.All integration tests MUST be located in the global integration directory:
tests/integration/[module]/[Feature].test.tsxvi.mock() for internal services or hooks; test their real interaction.tests/msw/handlers.ts and use server.use() for test-specific overrides.localStorage, sessionStorage, and MSW handlers are cleared between tests.// src/test/integration/auth/LoginFlow.test.tsx
import { render, screen, fireEvent } from '@/test/test-utils';
import { server } from '@/test/msw/server';
import { http, HttpResponse } from 'msw';
it('should complete the login flow successfully', async () => {
// 1. MSW intercepts the real service call
server.use(
http.post('*/api/auth/login', () => {
return HttpResponse.json({ token: 'fake_jwt', user: { name: 'Agus' } });
})
);
render(<LoginPage />);
// 2. Interact with the real UI
fireEvent.change(screen.getByLabelText(/email/i), { target: { value: 'test@example.com' } });
fireEvent.click(screen.getByRole('button', { name: /ingresar/i }));
// 3. Verify real hook state change reflected in UI
expect(await screen.findByText(/hola, agus/i)).toBeInTheDocument();
});