Skip to content

Commit 0d383d2

Browse files
docs: add test suite improvement roadmap and follow-up issue templates
- Created comprehensive roadmap (docs/test-suite-improvement-roadmap.md) - Added GitHub issue template for test improvements - Created 2 detailed priority issues (email service, notification service) - Organized issues by priority (P1/P2/P3) and estimated effort - Includes implementation checklists, code examples, and success metrics - Tracks 158 remaining test failures across 23 files - Goal: Increase test pass rate from 67.7% to 95%+ Co-authored-by: rezwana-karim <126201034+rezwana-karim@users.noreply.github.com>
1 parent d4f24b3 commit 0d383d2

5 files changed

Lines changed: 1074 additions & 0 deletions

File tree

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
---
2+
name: Test Suite Improvement
3+
about: Track systematic test suite improvements to increase pass rate
4+
title: 'test: [Component/Service] - Fix failing tests'
5+
labels: testing, technical-debt, good-first-issue
6+
assignees: ''
7+
---
8+
9+
## Context
10+
11+
Part of the Test Suite Improvement Roadmap to increase test pass rate from 67.7% to 95%+.
12+
13+
**Related**: See `docs/test-suite-improvement-roadmap.md` for full context.
14+
15+
## Problem
16+
17+
<!-- Describe the current test failures -->
18+
19+
**Failing Tests**: X tests in Y file(s)
20+
21+
**Files Affected**:
22+
- `path/to/test-file.test.ts`
23+
24+
**Root Cause**:
25+
<!-- Brief description of why tests are failing -->
26+
27+
## Proposed Solution
28+
29+
<!-- Describe the fix approach -->
30+
31+
### Changes Required
32+
33+
1. **Mock Setup**:
34+
```typescript
35+
// Example mock changes
36+
```
37+
38+
2. **Test Refactoring**:
39+
- [ ] Convert to ES modules (if needed)
40+
- [ ] Add proper mocking
41+
- [ ] Fix timing issues
42+
- [ ] Update assertions
43+
44+
3. **Test Infrastructure**:
45+
- [ ] Create reusable mocks (if applicable)
46+
- [ ] Document patterns
47+
48+
### Expected Outcome
49+
50+
- [ ] All X tests passing
51+
- [ ] TypeScript strict mode compliant
52+
- [ ] Tests run in < Y seconds
53+
- [ ] No test duplication
54+
- [ ] Proper mocking (no real API/DB calls)
55+
56+
## Implementation Checklist
57+
58+
### Development
59+
- [ ] Read `docs/test-suite-improvement-roadmap.md`
60+
- [ ] Review similar patterns in existing fixed tests
61+
- [ ] Set up local environment
62+
- [ ] Run failing tests to reproduce
63+
- [ ] Implement fixes incrementally
64+
- [ ] Run `npm run type-check`
65+
- [ ] Run `npm run lint`
66+
- [ ] Run affected tests: `npm run test -- path/to/test`
67+
68+
### Testing
69+
- [ ] All targeted tests passing
70+
- [ ] No new test failures introduced
71+
- [ ] Full test suite pass rate improved
72+
- [ ] Tests complete in reasonable time
73+
- [ ] Tests are deterministic (no flakiness)
74+
75+
### Documentation
76+
- [ ] Update test comments if needed
77+
- [ ] Document any new mock patterns
78+
- [ ] Update roadmap with progress
79+
- [ ] Add example to tests/README.md (if new pattern)
80+
81+
### Code Review
82+
- [ ] Self-review completed
83+
- [ ] No functional code changes (test-only PR)
84+
- [ ] Follows existing test patterns
85+
- [ ] Proper commit messages
86+
- [ ] PR description includes test results
87+
88+
## Acceptance Criteria
89+
90+
- [ ] All X tests passing (was: Y failing)
91+
- [ ] Test suite pass rate increased by Z%
92+
- [ ] No regressions in other tests
93+
- [ ] TypeScript/ESLint passing
94+
- [ ] Documentation updated (if new patterns)
95+
96+
## Test Results
97+
98+
### Before
99+
```
100+
Test Files N failed | M passed (total)
101+
Tests X failed | Y passed (total)
102+
```
103+
104+
### After
105+
```
106+
Test Files 0 failed | N+M passed (total)
107+
Tests 0 failed | X+Y passed (total)
108+
```
109+
110+
## Related Issues
111+
112+
<!-- Link to other test improvement issues -->
113+
114+
- Part of: Test Suite Improvement Roadmap
115+
- Depends on: #XXX (if applicable)
116+
- Blocks: #XXX (if applicable)
117+
118+
## Priority
119+
120+
<!-- Select one -->
121+
- [ ] P1 - Critical (blocks production)
122+
- [ ] P2 - Important (blocks features)
123+
- [ ] P3 - Nice to have (quality improvement)
124+
125+
## Estimated Effort
126+
127+
<!-- Select one -->
128+
- [ ] Small (< 4 hours)
129+
- [ ] Medium (4-8 hours)
130+
- [ ] Large (1-2 days)
131+
- [ ] X-Large (> 2 days)
132+
133+
## Notes
134+
135+
<!-- Any additional context, gotchas, or considerations -->

docs/issues/README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Follow-Up Issues for Test Suite Improvements
2+
3+
This directory contains pre-drafted GitHub issues for addressing the 158 remaining test failures.
4+
5+
## Quick Links
6+
7+
- [Roadmap](../test-suite-improvement-roadmap.md) - Full implementation plan
8+
- [Issue Template](../../.github/ISSUE_TEMPLATE/test-suite-improvement.md) - Template for new issues
9+
10+
## Priority 1 Issues (Critical)
11+
12+
### Issue 1: Email Service Test Refactoring
13+
**File**: `email-service-tests.md`
14+
**Impact**: 42 tests
15+
**Effort**: 4-6 hours
16+
**Description**: Convert email service tests from integration to unit tests with proper ES module imports and mocking.
17+
18+
### Issue 2: Notification Service Test Infrastructure
19+
**File**: `notification-service-tests.md`
20+
**Impact**: 22 tests
21+
**Effort**: 3-4 hours
22+
**Description**: Add Prisma mocking to notification service tests, remove real database dependencies.
23+
24+
## Priority 2 Issues (Important)
25+
26+
### Issue 3: Orders API Route Tests (next-auth mocking)
27+
**File**: `orders-api-tests.md`
28+
**Impact**: 15+ tests across 4 files
29+
**Effort**: 2-3 hours
30+
**Description**: Add standardized next-auth default export mocking to all orders API route tests.
31+
32+
### Issue 4: Analytics API Route Tests
33+
**File**: `analytics-api-tests.md`
34+
**Impact**: 30+ tests
35+
**Effort**: 4-5 hours
36+
**Description**: Fix authentication mock issues and parameter validation test expectations.
37+
38+
## Priority 3 Issues (Quality)
39+
40+
### Issue 5: Audit Logs Component Tests
41+
**File**: `audit-logs-tests.md`
42+
**Impact**: 8 tests
43+
**Effort**: 1-2 hours
44+
**Description**: Fix fetch spy assertion format to handle options parameter.
45+
46+
### Issue 6: Miscellaneous Component Tests
47+
**File**: `misc-component-tests.md`
48+
**Impact**: 20+ tests
49+
**Effort**: 6-8 hours
50+
**Description**: Apply systematic fixes to remaining component test failures.
51+
52+
## How to Use These Issues
53+
54+
1. Read the roadmap document first
55+
2. Choose an issue based on priority and your expertise
56+
3. Copy the issue content to GitHub
57+
4. Follow the implementation checklist
58+
5. Submit PR referencing the issue number
59+
6. Update roadmap with progress
60+
61+
## Creating New Issues
62+
63+
Use the template at `.github/ISSUE_TEMPLATE/test-suite-improvement.md` for consistency.
64+
65+
## Progress Tracking
66+
67+
| Issue | Status | Tests Fixed | PR |
68+
|-------|--------|-------------|-----|
69+
| #1 Email Service | 📋 Not Started | 0/42 | - |
70+
| #2 Notification Service | 📋 Not Started | 0/22 | - |
71+
| #3 Orders API Routes | 📋 Not Started | 0/15 | - |
72+
| #4 Analytics API Routes | 📋 Not Started | 0/30 | - |
73+
| #5 Audit Logs | 📋 Not Started | 0/8 | - |
74+
| #6 Misc Components | 📋 Not Started | 0/20 | - |
75+
76+
**Total Progress**: 0/137 tests fixed (0%)
77+
**Target**: 137/158 tests (87% of remaining failures)
78+
79+
---
80+
81+
**Note**: Update this file as issues are created and resolved.

0 commit comments

Comments
 (0)