Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

Data Cy: Unwrap Namespaces #597

Merged
merged 3 commits into from
Apr 26, 2019
Merged

Data Cy: Unwrap Namespaces #597

merged 3 commits into from
Apr 26, 2019

Conversation

ItsJonQ
Copy link
Contributor

@ItsJonQ ItsJonQ commented Apr 26, 2019

Data Cy: Unwrap Namespaces

This update fixes the propConnect data-cy attribute to ensure that any
"wrapping" namespaces, typically generated by HOCs, are stripped.

For example, propConnected(Header) becomes Header.

connected(Text) becomes Text.

Nested wrappers are also stripped, so withRouter(connected(Text)) becomes
Text.

Before:

Screen Shot 2019-04-25 at 8 46 58 PM

After:

Screen Shot 2019-04-25 at 8 49 07 PM

Manually tested by loading the beta build into the app!

Fixes:

#595

This update fixes the `propConnect` data-cy attribute to ensure that any
"wrapping" namespaces, typically generated by HOCs, are stripped.

For example, `propConnected(Header)` becomes `Header`.

`connected(Text)` becomes `Text`.

Nested wrappers are also stripped, so `withRouter(connected(Text))` becomes
`Text`.
@ItsJonQ ItsJonQ added bug 🐛 patch ☝️ To indicate patch version bumps labels Apr 26, 2019
@ItsJonQ ItsJonQ self-assigned this Apr 26, 2019
@ItsJonQ ItsJonQ mentioned this pull request Apr 26, 2019
...namespacedProps,
...rest,
className,
'data-cy': this.getDataNamespace(),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved down to override [data-cy] that my exist in ...rest. The this.getDataNamespace() method takes this.props into consideration.

@netlify
Copy link

netlify bot commented Apr 26, 2019

Deploy preview for hsds-react ready!

Built with commit 870a347

https://deploy-preview-597--hsds-react.netlify.com

@netlify
Copy link

netlify bot commented Apr 26, 2019

Deploy preview for hsds-react ready!

Built with commit 54bc9c8

https://deploy-preview-597--hsds-react.netlify.com

@coveralls
Copy link

coveralls commented Apr 26, 2019

Pull Request Test Coverage Report for Build 2073

  • 10 of 10 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 2071: 0.0%
Covered Lines: 7774
Relevant Lines: 7774

💛 - Coveralls

@ItsJonQ ItsJonQ merged commit 1f68510 into master Apr 26, 2019
ItsJonQ pushed a commit that referenced this pull request Apr 30, 2019
* Data Cy: Unwrap Namespaces

This update fixes the `propConnect` data-cy attribute to ensure that any
"wrapping" namespaces, typically generated by HOCs, are stripped.

For example, `propConnected(Header)` becomes `Header`.

`connected(Text)` becomes `Text`.

Nested wrappers are also stripped, so `withRouter(connected(Text))` becomes
`Text`.

* 2.33.1-1
ItsJonQ pushed a commit that referenced this pull request Apr 30, 2019
* Data Cy: Unwrap Namespaces

This update fixes the `propConnect` data-cy attribute to ensure that any
"wrapping" namespaces, typically generated by HOCs, are stripped.

For example, `propConnected(Header)` becomes `Header`.

`connected(Text)` becomes `Text`.

Nested wrappers are also stripped, so `withRouter(connected(Text))` becomes
`Text`.

* 2.33.1-1
@ItsJonQ ItsJonQ deleted the data-cy-unwrap-namespace branch May 8, 2019 19:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 patch ☝️ To indicate patch version bumps
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants