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

RN + Cannot create styled-component for component: undefined

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

thumbsup
2
message-simple
4

React Testing Library, getByRole and media queries

When running tests that use the RTL getByRole query, elements that are hidden by default but have a media query to make them visible do not get included unless I explicitly tell RTL to include hidden elements, even though the jest screen size when running tests would trigger the…

thumbsup
0
message-simple
0

<StyledHeading /> is using incorrect casing. Use PascalCase for React…

When I use yarn test to test my styled-components powered React component then I get following warning - Warning: <StyledHeading /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements. This happens when I separated out styled-components…

thumbsup
0
message-simple
5

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

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