menu

styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress!

Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# Help
view-forward
# jest
view-forward
# Off Topic
view-forward
# Website
view-forward
Team
Posts
Members
Info

Seeing duplicate elements logged in tests when using Enzyme's mount

In a CRA project, I have a Header component defined and used like so: When using Enzyme's mount and find to target the data-test-ids, my tests fail because find returns two nodes. This is the output when logging via console.log(wrapper.debug()): I can't tell if this is a CRA,…

thumbsup
0
message-simple
0

I can't mount with context after upgrading to react 16.6 and Styled Components…

I'm trying to run test with enzyme and I need to render some components which use properties from my global theme. Before I had to do something like But I noticed that getChildContext is not a function anymore so I thought about switching to this …

thumbsup
1
message-simple
14

Testing createGlobalStyle in v5

Hi! I am building a component library which has a component for global styles. In v4, the component was tested as follows: GlobalStyles …

thumbsup
0
message-simple
0

css.parse is not a function

I've been getting this error whenever testing with jest-styled-components. To combat this with v4, I made a fork that fixes the import culprit: https://github.com/dmitrizzle/jest-styled-components/blob/master/src/utils.js#L1 Basically, Node seems to be failing to follow the…

thumbsup
0
message-simple
0

#jest failling test

Trying to insert a new style tag, but the given Node is unmounted!

thumbsup
1
message-simple
2

RN + Cannot create styled-component for component: undefined

Testing with React Native and Jest produce the next error: Anyone with similar issues?

thumbsup
1
message-simple
3

I've updated to styled-components v5 beta and my jest-styled-components breaks

I've recently update my codebase to use the beta v5 of styled-components and my entire test-suite fails now! I'm using jest-styled-components which was working fine until today and now I'm getting the error Could neither find styled-components secret internals nor…

thumbsup
0
message-simple
2

Testing styled component

Does anybody have example of testing styled component? If please provide me

thumbsup
0
message-simple
1

In the jest-styled-components package, what is __PRIVATE__?

In src/utils.js on line 2, __PRIVATE__ is imported from styled-components. What is this? https://github.com/styled-components/jest-styled-components/blob/d140dd069f27ead5d123c1744c981952daa29f38/src/utils.js#L2

thumbsup
0
message-simple
1

I keep getting an "keyframe" error in Jest tests

I have a strange bug, that I have had problems reproducing outside of our environment and as such have a hard time filing as an actual bug, but it is linked to my update of styled-components from version 4.1.2 to 4.2.1. I hope any of you have any ideas. Our setup We have two…

thumbsup
0
message-simple
2