Skip to content

Commit 2b8dfda

Browse files
authored
Merge pull request #48 from 5elc0uth/feat/37-frontend-tests
feat: add frontend tests for create and pledge flows
2 parents e2b8fec + 70bd712 commit 2b8dfda

8 files changed

Lines changed: 1003 additions & 2 deletions

File tree

frontend/TESTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Frontend Testing Guide
2+
3+
## Setup
4+
5+
Dependencies are already installed. No extra steps needed.
6+
7+
## Running Tests
8+
9+
```bash
10+
cd frontend
11+
npm test
12+
```
13+
14+
## Test Files
15+
16+
- `src/components/CreateCampaignForm.test.tsx` — tests for campaign creation flow
17+
- `src/components/CampaignDetailPanel.test.tsx` — tests for pledge, claim, and refund flows
18+
19+
## What Is Covered
20+
21+
- All form fields render correctly
22+
- API errors display properly
23+
- Success messages display properly
24+
- Form resets after submission
25+
- Pledge submission calls the correct handler
26+
- Empty state renders when no campaign is selected
27+
28+
## Notes
29+
30+
- Tests use Vitest + React Testing Library
31+
- jsdom is used as the browser environment
32+
- `ECONNREFUSED` warnings during tests are expected — the backend is not running during testing and do not affect results

0 commit comments

Comments
 (0)