Add route tests for /api/webhooks/custom/[id]
Maintainer thường phản hồi trong vòng 1 ngày
@priyanshiy1312-ui đang làm issue này rồi.
Từ ngày 28/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 85/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nextjs, supabase, typescript
Hướng nghiên cứu
Bắt đầu với các handler GET, PATCH và DELETE trong src/app/api/webhooks/custom/[id]/route.ts, sau đó sao chép cấu hình mock từ test/goals-crud.test.ts và test/diff-trend-route.test.ts. Tạo test/api-webhooks-custom-id-route.test.ts, mock các module session, Supabase và GitHub bằng vi.mock, rồi gọi các handler với một NextRequest. Hoàn thành khi bốn trường hợp được liệt kê đều pass dưới pnpm test mà không có lệnh gọi mạng hoặc cơ sở dữ liệu thật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
src/app/api/webhooks/custom/[id]/route.ts (201 lines, handles GET, PATCH, DELETE) has no tests.
What to test
- returns 401 when there is no session
- returns the right error status when the Supabase call fails (mock it to return
{ error }) - returns 400 for a malformed or invalid body
- the happy path: correct status and response shape
How
Import the handler directly and call it with a NextRequest, mocking the session, Supabase and GitHub modules with vi.mock. test/goals-crud.test.ts and test/diff-trend-route.test.ts are good examples to copy from. No real network or database calls.
Acceptance criteria
- New file
test/api-webhooks-custom-id-route.test.ts - Every case above is covered and
pnpm testpasses
- Ngôn ngữ chính
- TypeScript
- Star
- 246
- Fork
- 436
- Merge trung bình
- 9 giờ 33 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Priyanshu-byte-coder/devtrack
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Priyanshu-byte-coder/devtrack#4067 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Priyanshu-byte-coder/devtrack#4066 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Webhook manager: replace the browser confirm() dialogs with ConfirmModalCó thể đã có người làm @Nandaninaulaa đã nhận 5 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Priyanshu-byte-coder/devtrack#3889 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Goals form: square arcade buttons for recurrence, Create goal and RefreshCó thể đã có người làm @KartikeyG-world đã nhận 5 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Priyanshu-byte-coder/devtrack#3877 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Goals: the error banner and the "No goals yet" hint show at the same timeCó thể đã có người làm @KartikeyG-world đã nhận 5 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Priyanshu-byte-coder/devtrack#3872 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Priyanshu-byte-coder/devtrack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Chocobozzz/PeerTube#7901 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
area:tools bug has repro
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
anthropics/claude-code#113984 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ehmpathy/declapract-typescript-ehmpathy#960 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Web UI: Pressing Ctrl+<key> with Caps Lock active triggers Ctrl+Shift+<key> shortcutsĐang mởarea/web platform/windows type/bug version/v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
anomalyco/opencode#68237 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100