Tests for delete_recording's confirmation and partial-failure paths

Đang mở Phù hợp với người mới
#351 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đá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
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
testing

Hướng nghiên cứu

Đọc src/tools/deleteRecording.ts và các trường hợp hiện có trong src/__tests__/deleteRecording.test.ts; so sánh mẫu client hỗ trợ elicitation trong src/__tests__/consentLogging.test.ts. Thêm các trường hợp xác nhận và lỗi một phần đã nêu, sau đó chạy npm test. Hoàn tất khi các bài kiểm thử bao phủ từng đường dẫn đã nêu và xác minh rằng các tệp, sidecar và mục đăng ký được giữ lại hoặc xóa theo yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

effort: small good first issue priority: medium testing

Summary

delete_recording is the only tool that irreversibly removes user data, but its test client is created without capabilities, so confirmDelete always takes the no-elicitation early return. Never exercised: decline/cancel, a failed elicitation, the SCREENCAST_CONFIRM_CAPTURE refusal, "Nothing to delete", and the rmSync failure branch that keeps the registry entry. Branch coverage of the file is 60%.

Where

  • src/tools/deleteRecording.ts:33-53, 96, 106-124
  • src/__tests__/deleteRecording.test.ts:47 (client without elicitation)

Suggested fix

Add cases with an elicitation-capable client (the pattern in src/__tests__/consentLogging.test.ts:76-77):

  • "decline": isError "declined by the user"; file, sidecars and registry entry kept.
  • "cancel": isError "cancelled"; nothing deleted.
  • the elicitation handler throws: isError "the confirmation request failed"; nothing deleted.
  • "accept": deleted, and confirmedByUser: true.
  • no elicitation and SCREENCAST_CONFIRM_CAPTURE=1: isError naming the env var; nothing deleted.
  • a path that does not exist and no session: isError "Nothing to delete".
  • one sidecar fails to delete (mock rmSync): failed lists it, and the registry entry is kept.

Getting started

  • Relevant files: src/tools/deleteRecording.ts, src/__tests__/deleteRecording.test.ts
  • How to run tests: npm test

Filed by repo-audit/full-audit at b9b94fa. Severity: medium. Effort: S. audit-key: testing|src/tools/deleteRecording.ts|confirmDelete

Ngôn ngữ chính
TypeScript
Star
1
Fork
4
Merge trung bình
14 giờ 8 phút
Pull request đã merge (30 ngày)
48

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/screencast-mcp

Tất cả issue của TMHSDigital/screencast-mcp

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.