fix(checks/unsupportedrole): support unsupported dpub and fallback roles, add role to message#3395
Merged
straker merged 53 commits intodequelabs:developfrom Feb 28, 2022
Merged
Conversation
Make `internal-link-present-evaluate` work with virtualNode rather than actualNode. Closes issue dequelabs#2466
This reverts commit 9f996bc.
…ractive" Closes issue dequelabs#2934
…dequelabs-develop-2
Dequelabs develop 2
work in progress
work in progress
straker
requested changes
Feb 25, 2022
Contributor
straker
left a comment
There was a problem hiding this comment.
Thanks for the pr. Overall it looks good, the only request I have is that we'll want to check the checkContext._data to ensure that the role is set (since we weren't setting it before).
So for tests that return true, we'll check that the role is set:
assert.deepEqual(checkContext._data, [role]);and for tests that return false, we'll want to check that it's null
assert.isNull(checkContext._data);See https://github.com/dequelabs/axe-core/blob/develop/test/checks/aria/deprecatedrole.js for examples of doing this.
Closes issue dequelabs#3282
…o single string to match lib/checks/aria/deprecatedrole-evaluate.js
… array to single string" This reverts commit e7c757f9330b635b1ed16385b3526f2e71786488.
Contributor
Author
|
That makes sense. I like axe-core's test philosophy. Does my latest push reflect what you have in mind? |
straker
approved these changes
Feb 28, 2022
Contributor
Author
|
Nice. Thanks again for the guidance. |
rafaelpaniago1
added a commit
to masganem/axe-core-mes-20252
that referenced
this pull request
Nov 7, 2025
Corrige três problemas no check 'unsupportedrole':
1. Valor do role não sendo adicionado ao data
- Adiciona this.data(role) quando role é não suportado
- Permite que mensagem exiba o role específico
2. Roles dpub não reconhecidos
- Adiciona opção { dpub: true } ao chamar getRole()
- Agora detecta roles como 'doc-abstract', 'doc-chapter', etc.
3. Fallback roles não suportados
- Adiciona opção { fallback: true } ao chamar getRole()
- Permite detecção em casos como role='unsupported alert'
Arquivos modificados:
- lib/checks/aria/unsupportedrole-evaluate.js
* Adiciona { dpub: true, fallback: true } ao getRole()
* Usa this.data() para passar role para mensagem
- lib/checks/aria/unsupportedrole.json
* Corrige template de ${data.values} para ${data}
- test/checks/aria/unsupportedrole.js
* Usa MockCheckContext para verificar _data
* Adiciona testes para dpub roles
* Adiciona testes para fallback roles
* Verifica que data é setado corretamente
Comparação com PR oficial dequelabs#3395:
- Similaridade: 99.8%
- Diferenças: Apenas espaçamento (LLM usa linha antes do if)
- Lógica: 100% idêntica
- Testes: 100% idênticos
- Mensagens: 100% idênticas
Issue: dequelabs#3282
PR Oficial: dequelabs#3395
Análise detalhada em: ANALISE-ISSUE-3282.md
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.
fix(rules): unsupportedrole check bugs
Closes issue #3282