-
Notifications
You must be signed in to change notification settings - Fork 0
Increase test coverage across the project #3
Copy link
Copy link
Open
Description
The current test coverage in the NEARmeet project is insufficient. This issue proposes to increase the number of tests and ensure that critical paths, edge cases, and major components are covered. Tasks include identifying untested code, adding unit and integration tests, and reporting updated coverage metrics.
Current Status
🚨 Low Coverage Alert:
- Core functionality lacks test validation (current coverage: ~XX%).
- Critical paths (e.g., event creation, RSVPs) have minimal/no edge-case testing.
- Untested components risk stability as we scale.
Proposed Actions
1. Coverage Audit (Week 1)
- Identify Gaps: Use jest --coverage + manual review to flag:
- Untested files (prioritize src/components/Event/, src/lib/web3.js).
- Partial coverage (e.g., missing error handlers in API calls).
- Document: Create TESTING_GAPS.md listing:
High-Priority Files
EventForm.js(45% coverage)- Missing: Form validation, NFT ticket edge cases
wallet-connector.js(30% coverage)- Missing: Network switch handling, failed TX fallbacks
2. Test Implementation (Weeks 2-3)
- Unit Tests (Jest + Testing Library):
- Atomic component tests (e.g., button states, form submissions).
- Mocked Web3 interactions (e.g., NEAR wallet signIn()).
- Integration Tests (Cypress):
-
Critical user flows:
Scenario: Create an event with NFT gating
Given a connected wallet
When filling valid event details + NFT requirements
Then the event is listed with "NFT-only" badge -
Edge cases:
- Wallet disconnection during RSVP.
- Insufficient gas for blockchain ops.
3. CI/CD Integration
- Enforce Thresholds:
- Fail builds if coverage drops below 80% for main branch.
- Add GitHub Actions step:
-
name: Test Coverage
run: |
jest --coverage --coverageThreshold='{"global":{"lines":80}}' -
Report Metrics:
- Auto-post coverage updates to PRs via codecov.io.
- Monthly trend reports (e.g., via GitHub Wiki).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels