-
Notifications
You must be signed in to change notification settings - Fork 109
Fix advanced AngularJS array and props tests #211
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
Fix advanced AngularJS array and props tests #211
Conversation
|
@robdodson any chance I can get feedback on this pull request? |
robdodson
left a comment
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.
Sorry for the delay! Commented.
| let root = prep("<comp-with-props>") | ||
| scope.$digest() | ||
| let wc = root.querySelector('#wc') | ||
| let data = wc.arr || wc.getAttribute('arr') |
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.
It shouldn't be calling getAttribute here. For arrays and objects, the test is trying to assert that they are always passed as JS properties.
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.
👍
| let root = prep("<comp-with-props>") | ||
| scope.$digest() | ||
| let wc = root.querySelector('#wc') | ||
| let data = wc.obj || wc.getAttribute('obj') |
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.
Same as above.
robdodson
left a comment
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.
oops. meant to click 'request changes'.
fad5f9a to
8d51383
Compare
|
@robdodson thanks for the feedback! Fixed. |
|
Just started reviewing :) |
|
Looks good. Since I'm totally not an AngularJS expert, can you explain a bit about what this change actually does? I noticed the test still fails (which is what I expected because AngularJS isn't setting properties here). But I was just curious what all the setup work does. |
|
Happy to explain! What I'm doing is compiling isolated instances of the angular components that are supposed to pass more complicated data to the child custom elements inside. Since Here's the angular component that wasn't getting rendered before: It now correctly compiles the angular component with properties/array and tests if the custom element inside is receiving them. |
|
Cool, thanks for the PR! |
The current tests don't setup the components to test these attributes against expectations.