-
Notifications
You must be signed in to change notification settings - Fork 7
Fix DateInput tests and standardize date handling #1069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jvictordev1
merged 6 commits into
main
from
hotfix/fix-date-input-tests-16465431169864620625
Mar 13, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
266975b
Fix DateInput tests and standardize date handling
google-labs-jules[bot] 113eac5
Final fix for DateInput tests and date handling standardization
google-labs-jules[bot] 5d52d13
refactor: corrige aparição de placeholder no basemobileinput e remove…
242f78b
build: bumpa versão do projeto
0b87358
Fix DateInput tests and standardize date handling
google-labs-jules[bot] 80e146a
Update package version and standardize date handling
google-labs-jules[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export default ['text', 'textarea', 'email', 'password', 'tel', 'number', 'search', 'url']; | ||
| export default ['text', 'textarea', 'email', 'password', 'tel', 'number', 'search', 'url', 'date']; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Padrão default de prop avaliado em tempo de carregamento do módulo
DateTime.now().yearnessa posição (dentro do objeto literal dedefineProps) é avaliado uma única vez, quando o módulo é importado, e não por instância do componente. Isso acontece porque o compilador do Vue 3 extrai o objeto dedefinePropspara o nível de módulo (nas opções do componente), fora da funçãosetup.Por isso, mocks de
Settings.nowconfigurados nobeforeEachdos testes não afetam esse valor padrão, pois o módulo já foi importado antes de qualquerbeforeEachser executado. Os testes atuais passam porque o ano mockado (2026) coincide com o ano real — mas isso é frágil.A variável
todayYearemYearSelectorGrid.vuenão tem esse problema porque é declarada diretamente no topo dosetup()(dentro do corpo da função), sendo avaliada por instância.Para garantir que o default seja avaliado por instância e respeite mocks em testes, utilize uma factory function:
Rule Used: What: Components in Vue 3 must adhere to the speci... (source)