jargonsdev / jargonsdev/jargons.dev

Phase 3: API Endpoint Tests - Authentication & Dictionary APIs

Open
#173 1 comment 0 reactions 1 assignee View on GitHub

@babblebey is already working on this.

Since Oct 19, 2025.

:sparkles: enhancement maintainers-only
Dominant language
MDX
Stars
56
Forks
45
PR merge metrics
No merged PRs in 30d

Description

**Part of:** #170
**Depends on:** #171

## 📋 Phase 3: API Endpoint Tests (High Priority)

### Scope
This phase focuses on testing all API endpoints - the external interface and user-facing functionality.

### 4. **API Routes** (`src/pages/api/`)
**Why critical**: External interface, user-facing functionality.

#### `api/dictionary.js` - Main Dictionary API
**POST endpoint (word submission)**
- [ ] Authentication validation
- [ ] Input sanitization
- [ ] Word creation flow
- [ ] Word editing flow
- [ ] Error responses

**DELETE endpoint (branch cleanup)**
- [ ] Authentication validation
- [ ] Branch deletion
- [ ] Error handling

#### `api/github/oauth/` - Authentication
- [ ] OAuth authorization flow
- [ ] Callback handling
- [ ] Token validation
- [ ] Error scenarios

#### `api/v1/browse/` - Browse Functionality
- [ ] Dictionary browsing endpoints
- [ ] Pagination logic
- [ ] Search functionality
- [ ] Error handling

## 🎯 Success Criteria
- 70%+ coverage for API endpoints
- All authentication flows tested
- Input validation thoroughly tested
- Error scenarios properly handled
- Security validation for auth flows

## 📅 Timeline
**Week 3** of testing implementation

## 🛠️ Setup Required
- Set up API testing framework
- Mock external GitHub API calls
- Create test database/fixtures
- Set up authentication mocking

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.