`insertCss` constraint
See original GitHub issueAloha everyone,
during test coverage of my component i found the problem with shallow rendering.
For example code using enzyme
:
const StyledComponent = withStyles('')(
class Foo extends Component {
render() {
return <div />;
}
}
);
expect(shallow(<StyledComponent />).html()).to.equal('<div></div>');
After execute this code, test return error: Cannot read property 'apply' of undefined
.
I found the cause of this error, and change withStyles
module for fix error while maintaining backward compatibility.
About reason of error. I think this insertCss
as required property in propTypes
is unjustified constraint, because when you need create isolated test of component you can’t do this.
What you think about this issue?
Thanks!
P.S. if maintainer or community decide that actually problem, i can do PR for resolve this issue.
<bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38033508-insertcss-constraint?utm_campaign=plugin&utm_content=tracker%2F26439769&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F26439769&utm_medium=issues&utm_source=github). </bountysource-plugin>Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:11 (1 by maintainers)
Top Results From Across the Web
tabs.insertCSS() - Mozilla - MDN Web Docs
This is an asynchronous function that returns a Promise (on Firefox only). Syntax. let inserting = browser.tabs.insertCSS( ...
Read more >How to run chrome.tabs.insertCSS from the background page ...
chrome.tabs.onCreate has to be replaced with chrome.tabs.onCreated (with a d!). After fixing this, you'd better pass a tabId to the ...
Read more >Developers - `insertCss` constraint - - Bountysource
during test coverage of my component i found the problem with shallow rendering. For example code using enzyme : const StyledComponent = withStyles('')(...
Read more >Introducing chrome.scripting - Chrome Developers
Second, our API had a different set of design constraints (e.g. ... In Manifest V2, executeScript and insertCSS would return an array of ......
Read more >Problem upgrading from 8.9.16 to 9.2.0 | Drupal.org
0] but it does not match the constraint. - composer/installers[v1.7.0, .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here, thanks guys!
Maybe
withStyles
higher-order component should not requirecontext.insertCss
and just warn if it was not provided, ref #63@koistya what do you think?