Generics not supported when using bound functions
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, react, typescript
Direção de pesquisa
Comece pelas queries retornadas por render e compare seu tratamento genérico com o das screen queries, usando como referência a implementação vinculada de screen-generics. O trabalho estará concluído quando os chamadores puderem passar element generics para as queries retornadas por render sem typecasts repetidos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Describe the feature you'd like:
Happy to give this a try myself!
I've found myself repeating the same pattern of typecasting elements returned from queries when using render when I need to access specific element properties as the return type for queries is always HTMLElement as seen in the two below screenshots:
Suggested implementation:
Firstly I thought about using function overloads and literal types to fix this problem but then realised any HTML element can be assigned a role so I then thought about using generics and came across this old issue which was implemented several years ago. In that thread it said the generics got lost when using screen, which was addressed and fixed but it looks like the same problem applies to render.
I imagine the fix will be similar to that found when adding generics to screen queries
Describe alternatives you've considered:
Open to suggestions
Teachability, Documentation, Adoption, Migration Strategy:
Allow users to pass generics to queries returned from render:
- Linguagem predominante
- JavaScript
- Estrelas
- 19.7k
- Forks
- 1.2k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de testing-library/react-testing-library
-
fireEvent.select does not wrap its automatic native focus in actTalvez já em andamento @sergioperezcheco assumiu há 8 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
bug: calling configure() without reactStrictMode resets it to undefined, silently disabling strict modeTalvez livre de novo @suhailopensource assumiu há 78 dias e não há nenhum pull request aberto. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
testing-library/react-testing-library#1466 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
testing-library/react-testing-library#1459 · 2 comentários ·
-
perf: optimize container lookup with early exitTalvez livre de novo @Ch-Abhinav-Chowdary assumiu há 304 dias e não há nenhum pull request aberto. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 35/100
testing-library/react-testing-library#1430 · 1 comentário ·
-
`fireEvent.mouseEnter` does not forward `relatedTarget` (relatedTarget is the window instead)Talvez já em andamento @swarnim02 assumiu há 322 dias. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
Todas as issues de testing-library/react-testing-library
Issues semelhantes
-
documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
andromarces/agent-loops#886 ·
Mantenedores costumam responder em até 1 dia
-
bug effort:low model:light plan planner:gpt-6-1-sol tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
B: visual
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
FreeTubeApp/FreeTube#9929 ·
Mantenedores costumam responder em até 1 dia
-
🐛 Bug: `--clear-screen` not very useful (at least not for dealing with large test/error output)Abertastatus: in triage type: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
mochajs/mocha#6428 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
supabase/supabase-js#2768 ·
Mantenedores costumam responder em até 1 dia