test(chat): regressão funcional do filtro ?q= em /conversations - #229
Merged
Conversation
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.
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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
Fecho o último gap de verificação do PR #226: o filtro
?q=deGET /conversations(busca por título + conteúdo das mensagens) tinha cobertura apenas estrutural (typecheck); agora tem regressão funcional.Mudanças
conversation.findManyemserver/tests/conversations-routes.test.tsagora avalia as condiçõesOR(title contains+messages.some.content contains), emulando o comportamento case-insensitive do Prisma.?q=DEPLOYencontra por título (case-insensitive);?q=postgresencontra conversa cujo conteúdo de mensagem bate, sem incluir conversas só de título similar;user-2não vaza na busca deuser-1);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/status200 com payload correto,/conversations?q=401 sem auth conforme esperado, homepage renderiza com o script anti-flash de accent).