Como testar mocks de dados de APIs do HTML5 em componentes React, usando o Jest #392
Unanswered
felquis
asked this question in
Perguntas e Respostas
Replies: 3 comments
-
Não faz mais sentido testar isso usando uma ferramenta de E2E? Recomendo o Dalek =) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Na pegada que o @fdaciuk postou: https://github.com/segmentio/nightmare |
Beta Was this translation helpful? Give feedback.
0 replies
-
@felquis dá pra usar também a API de eventos. const node = document.createElement('div')
node.addEventListener('click', e => {
console.log(e)
})
const event = document.createEvent('Event')
event.initEvent('click', true, true)
node.dispatchEvent(event) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Fala pessoal, estou trabalhando nos testes do repositório react-event-components, usando o react-scripts ejetado com o jest e, para conseguir aumentar o test coverage preciso simular alguns eventos como geolocalização, window resize, touchstart, touchmove, touchend e eu simplesmente travei.
Alguém da comunidade teria uma sugestão de como passar dessa faze? Obrigado :)
Beta Was this translation helpful? Give feedback.
All reactions