Add support for data-test-* properties#70
Open
jrjohnson wants to merge 2 commits intoember-codemods:masterfrom
Open
Add support for data-test-* properties#70jrjohnson wants to merge 2 commits intoember-codemods:masterfrom
jrjohnson wants to merge 2 commits intoember-codemods:masterfrom
Conversation
When these are set to boolean true they are added to the element, boolean false are skipped (can't think of why these would exist) When they are set to a literal value that value is used. Anything else throws.
Turbo87
reviewed
Mar 30, 2020
Contributor
Turbo87
left a comment
There was a problem hiding this comment.
@jrjohnson thanks for the PR. similar to the ember-component-css code we have, could you add a check that only enables this transform if the app has a ember-test-selectors dependency? 🙏
Contributor
Author
|
@Turbo87 ✔️ |
Turbo87
reviewed
Apr 1, 2020
| debug('classNameBindings: %o', classNameBindings); | ||
|
|
||
| let dataTestAttributes = findDataTestAttributes(properties); | ||
| debug('dataTestAttributes: %o', dataTestAttributes); |
Contributor
There was a problem hiding this comment.
hmm, instead of creating a dedicated thing here, I'm wondering if it would be easier to just add all the data-test-* properties to the attribute bindings? that's what ember-test-selectors does internally and it would also support computed properties that way. I'm just not sure if data-test-foo={{this.data-test-foo}} is valid code due to the - in the property name 🤔
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.
When these are set to boolean true they are added to the element,
boolean false are skipped (can't think of why these would exist)
When they are set to a literal value that value is used.
Anything else throws.
I only handled classic components because I'm not sure if setting properties like this works on classes. If that's a working case let me know and I'll add it.
Fixes #34