-
Notifications
You must be signed in to change notification settings - Fork 124
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
Include repeated attributes warning for panel elements #2053
Conversation
@tlylt Thanks for the heads up! I will add in some tests for this issue. |
If suitable, you can add tests to the existing test files related to the panel. Have you added new test cases specifically for triggering/not triggering the repeated attributes warning? (Possibly with relevant text mentioning what's being tested for the test cases) |
I could not find test cases specifically for triggering / not triggering the repeated attributes warnings for the Popover / Dropdown elements (warnings for these elements have been previously implemented) after a quick search, but I could have missed them, so I'll give it a more thorough search! On another note, the logger currently uses the winston logger to output such warnings for elements, but I did not find any test cases testing the winston logger (again, I could have missed them... 😅). If so, it may be worthwhile to look into implementing test cases for the logger, which seems reasonably feasible (but out of scope for this particular pull request, so I'll open another issue for this if this happens to be the case). |
Probably means they are not written, can file an issue for those separately.
I don't think we have the mechanism to match console output at the moment, but we still want to have the cases captured so that minimally on visual inspection we can see the warnings being logged. Good suggestion for having such an implementation... yes we can file another issue to take that forward 👍 |
To clarify, the case in |
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.
Thank you @lhw-1 , the tests look pretty comprehensive in testing slot/attribute/overrides! Just some comments on the alt
slot.
On a side note, we could use more tests for all the features we support with panels (e.g. peek, no-close, etc). That's out of the scope of the PR though so don't worry about it :)
Agreed on this, I think for this PR we can add a comment for just the panels. 😃 |
Do those unit tests have their individual cases that they are checking for? If so I think we might want to create another similar one (somewhere below perhaps) with the sole focus on the conditions that will trigger the warning. This might help make tests isolated and avoid unnecessary changes in the future. What do you think, @lhw-1? |
Ah, I see what you mean. Yes, I think that would be a good solution in the meantime as well - I'll get to it. Thank you! |
packages/cli/test/functional/test_site/expected/testPanels.html
Outdated
Show resolved
Hide resolved
I have added unit tests for panels here. It seems that there were actually unit tests for this case but only for dropdown elements here, for future reference. Once this is good to go & hopefully gets merged, I will open up new issues as mentioned in the "things to highlight / discuss" section above (I've updated it) 👍 |
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.
LGTM! 👍
What you've mentioned under "things to highlight/discuss" sound like good ideas to me as well! Thanks for opening the issues :)
@all-contributors please add @lhw-1 for code |
I've put up a pull request to add @lhw-1! 🎉 |
What is the purpose of this pull request?
Overview of changes:
Resolves #1764
Related to #1780 which partially resolved this issue but was undocumented
Anything you'd like to highlight/discuss:
While this pull request resolves the original issue of repeated attributes in
panel
elements not logging a warning message, there may be additional work required to streamline the process of adding warnings instead of declaring a warning case for every element as is currently being done: linkThree further issues have been proposed thus far:
Testing instructions:
Proposed commit message: (wrap lines at 72 characters)
Include repeated attributes warning for panel elements
Checklist: ☑️