Skip to content
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

feat(material/schematics): add fn for adding attrs to templates #24550

Merged

Conversation

wagnermaciel
Copy link
Contributor

  • create and unit test addAttribute fn

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a test scnario for multiple arguments on a single element would be cool.

@wagnermaciel
Copy link
Contributor Author

LGTM, a test scnario for multiple arguments on a single element would be cool.

@devversion That's outside of the scope of what's needed for the migration. We'll only need to add a single one. Would be easy to add that functionality in if it becomes relevant in the future

@wagnermaciel wagnermaciel added the target: feature This PR is targeted for a feature branch (outside of main and semver branches) label Mar 8, 2022
@wagnermaciel wagnermaciel merged commit b604858 into angular:mdc-migration Mar 8, 2022
@devversion
Copy link
Member

@devversion That's outside of the scope of what's needed for the migration. We'll only need to add a single one. Would be easy to add that functionality in if it becomes relevant in the future

My philosophy usually is: if you are building a generic utility like this, and this is a common scenario usually, then it should be tested as it's low-effort (4-5 lines), proofs that the API can be useful for other usages as well, and works (because future uses might not be testing all code paths -- its easy to forget about this then 😛 )

@wagnermaciel
Copy link
Contributor Author

@devversion I think I may have misunderstood you. Did you want to test using the addAttribute fn multiple times or extend and then test the functionality of addAttribute so that it could add multiple attributes like this

addAttribute(html: string, node: Element, attributes: {[key: string]: string}[])

@devversion
Copy link
Member

@wagnermaciel I was just thinking of having a test where you'd call addAttribute multiple times. Sorry if that was unclear.

@wagnermaciel
Copy link
Contributor Author

@devversion Ah, gotcha. No problem then, I'll just throw in a test for it in a follow-up PR 👍🏽

devversion pushed a commit to devversion/material2 that referenced this pull request Mar 14, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: feature This PR is targeted for a feature branch (outside of main and semver branches)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants