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

Support nested arrays in style prop #12

Merged
merged 1 commit into from
Nov 18, 2019

Conversation

Shywim
Copy link
Contributor

@Shywim Shywim commented Nov 17, 2019

What: This fixes not being able to test components which receive nested arrays in their style prop.

Why: react-native allows nested array for the style prop. Although it's not explicity written in the docs but TypeScript typings for react-native allow it and some libraries (at least react-native-paper) are making use of them.

How: We flatten the style prop before using mergeAll

Checklist:

  • Documentation added to the
    docs (N/A)
  • Typescript definitions updated (N/A)
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Nov 17, 2019

Codecov Report

Merging #12 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #12   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           8      8           
  Lines          89     90    +1     
  Branches       23     23           
=====================================
+ Hits           89     90    +1
Impacted Files Coverage Δ
src/to-have-style.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 115f296...ee9b585. Read the comment docs.

Copy link
Collaborator

@bcarroll22 bcarroll22 left a comment

Choose a reason for hiding this comment

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

Cool! Thanks for this!

@bcarroll22
Copy link
Collaborator

@allcontributors please add @Shywim for code

@allcontributors
Copy link
Contributor

@bcarroll22

I've put up a pull request to add @Shywim! 🎉

@bcarroll22 bcarroll22 merged commit 9a73e59 into testing-library:master Nov 18, 2019
@bcarroll22
Copy link
Collaborator

🎉 This PR is included in version 3.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants