Repository navigation
test(cid10): adiciona testes para o endpoint OMS CID-10 - #935
Open
PaulooBarros wants to merge 1 commit into
Open
PaulooBarros wants to merge 1 commit into
PaulooBarros wants to merge 1 commit into
Conversation
Cobre listagem completa, busca por código e subcódigo, código inexistente (404), sensibilidade a maiúsculas/minúsculas e CORS. Closes BrasilAPI#934 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@PaulooBarros is attempting to deploy a commit to the BrasilAPI Team on Vercel. A member of the Team first needs to authorize it. |
|
This branch has not been deployed
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.



📋 Descrição
Adiciona testes E2E para os endpoints de CID-10 (
/api/oms/cid10/v1e/api/oms/cid10/v1/{code}), que até então não tinham cobertura emtests/.Novo arquivo
tests/oms-cid10-v1.test.js, cobrindo:GET /api/oms/cid10/v1: status 200, lista não vazia, e cada item tem exatamentecodigoenome(strings)GET /api/oms/cid10/v1/A00: retorna{ "codigo": "A00", "nome": "Cólera" }GET /api/oms/cid10/v1/A00.0: busca por subcódigo retorna o item corretoGET /api/oms/cid10/v1/ZZZ99: 404 commessage: "CID10 não encontrado"etype: "not_found"GET /api/oms/cid10/v1/a00: 404, documentando que hoje a busca diferencia maiúsculas de minúsculastestCorsForRouteNenhum código de produção foi alterado.
🎯 Tipo de Mudança
📚 Checklist de Documentação
/pages/docs/doc/🧪 Checklist de Testes
npm test)💻 Checklist de Código
npm run fixantes de commitar🚀 Checklist de Performance e Custos
🔍 Como Testar
npm installnpm test -- tests/oms-cid10-v1.test.js📸 Screenshots (se aplicável)
N/A
📎 Issues Relacionadas
Closes #934
📝 Notas Adicionais
O teste com
a00registra o comportamento atual (busca sensível a maiúsculas/minúsculas). Se a ideia for aceitar os dois formatos, posso abrir uma issue separada, já que isso mudaria o comportamento do endpoint.O commit foi feito com
--no-verify: o pre-commit rodaeslint .no repositório inteiro e hoje falha namainpor 6 erros que já existiam, em arquivos fora deste PR (tests/cep-v1.test.js,tests/cpetc/previsao-v1.test.js,tests/docs-spec-refs.test.jsetests/ibpt-v1.test.js). O arquivo novo passa no ESLint sem erros (npx eslint tests/oms-cid10-v1.test.js). Posso corrigir esses erros em um PR separado, se fizer sentido.Pontos de Atenção Críticos:
Lembre-se: BrasilAPI serve milhares de desenvolvedores e empresas importantes. Mudanças devem ser cuidadosamente avaliadas para garantir confiabilidade e zero downtime.