Skip to content

test(chat): regressão funcional do filtro ?q= em /conversations - #229

Merged
actus7 merged 2 commits into
mainfrom
test/conversations-q-regression
Aug 17, 2026
Merged

test(chat): regressão funcional do filtro ?q= em /conversations#229
actus7 merged 2 commits into
mainfrom
test/conversations-q-regression

Conversation

@actus7

@actus7 actus7 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Resumo

Fecho o último gap de verificação do PR #226: o filtro ?q= de GET /conversations (busca por título + conteúdo das mensagens) tinha cobertura apenas estrutural (typecheck); agora tem regressão funcional.

Mudanças

  • O mock de conversation.findMany em server/tests/conversations-routes.test.ts agora avalia as condições OR (title contains + messages.some.content contains), emulando o comportamento case-insensitive do Prisma.
  • Novos casos de teste:
    • listagem sem filtro retorna todas as conversas do usuário;
    • ?q=DEPLOY encontra por título (case-insensitive);
    • ?q=postgres encontra conversa cujo conteúdo de mensagem bate, sem incluir conversas só de título similar;
    • isolamento entre usuários (conversa de user-2 não vaza na busca de user-1);
    • termo sem correspondência retorna lista vazia.

Verificações

  • pnpm vitest run server/tests/conversations-routes.test.ts (4/4)

Contexto: verificação de "garantia total" pós-merge de #225#228 — CI pós-merge no main (6/6 sucesso), deploy de produção success, suíte combinada local (352 testes ✓) e smoke runtime local (/ollama/api/status 200 com payload correto, /conversations?q= 401 sem auth conforme esperado, homepage renderiza com o script anti-flash de accent).

O mock de conversation.findMany agora avalia as condicoes OR (titulo +
conteudo de mensagens), e os novos casos cobrem: listagem sem filtro,
match por titulo, match por conteudo de mensagem, isolamento entre
usuarios e ausencia de resultados.
Copilot AI lite review requested due to automatic review settings August 17, 2026 14:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added backend Backend changes tests Test changes labels Aug 17, 2026
A anotacao anterior tipava o objeto do parametro como o valor de where,
quebrando o tsc (TS2339/TS7006). Corrige para { where: {...} } com
where obrigatorio e OR opcional, como o route invoca.
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelhub Error Error Aug 17, 2026 2:42pm

@actus7
actus7 merged commit 0ae830b into main Aug 17, 2026
14 of 15 checks passed
@actus7
actus7 deleted the test/conversations-q-regression branch August 17, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants