Tests for delete_recording's confirmation and partial-failure paths

Aberta Para iniciantes
#351 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
84/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript
Domínio
testing

Direção de pesquisa

Leia src/tools/deleteRecording.ts e os casos existentes em src/__tests__/deleteRecording.test.ts; compare o padrão de cliente compatível com elicitation em src/__tests__/consentLogging.test.ts. Adicione os casos indicados de confirmação e falha parcial e, em seguida, execute npm test. O trabalho estará concluído quando os testes cobrirem cada caminho indicado e verificarem que os arquivos, os sidecars e as entradas do registro sejam preservados ou removidos conforme especificado.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
TypeScript
Estrelas
1
Forks
4
Merge médio
14h 8min
PRs com merge (30d)
48

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/screencast-mcp

Todas as issues de TMHSDigital/screencast-mcp

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.