Socket
Socket
Sign inDemoInstall

coflux

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

4

lib/wrapComponent.js

@@ -39,2 +39,6 @@ 'use strict';

function buildGranchildDependencies(child) {
// Bail if child is not a component (e.g. a string)
if (!_react2.default.isValidElement(child)) {
return;
}
var childComponent = child.type.nativeComponent;

@@ -41,0 +45,0 @@

2

package.json
{
"name": "coflux",
"version": "0.2.0",
"version": "0.2.1",
"description": "Component-based Flux",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -353,3 +353,50 @@ jest.autoMockOff();

});
it('works with non-element children', () => {
const nodeWithTextChild = ({ test, children, actions }) => {
return (
<div onClick={actions.triggerUpdate}>
{test} {children}
</div>
);
};
const NodeWithTextChild = wrap(nodeWithTextChild, {
mapStateToProps() {
return {
test: 'test',
};
},
actions: {
triggerUpdate(props, next) {
next({ test: 'bar' });
},
},
});
const store = {
test: 'foo',
};
const tree = mount(
<Provider store={store}>
<NodeWithTextChild>
test
</NodeWithTextChild>
</Provider>
);
/*
* simulate the click to update state
*/
const nodeWrapper = tree.find('[onClick]');
nodeWrapper.simulate('click');
/*
* EXPECTATION
*/
expect(
nodeWrapper.text()
).toBe('bar test');
});
});

@@ -25,2 +25,6 @@ /*

function buildGranchildDependencies(child) : void {
// Bail if child is not a component (e.g. a string)
if (!React.isValidElement(child)) {
return;
}
const childComponent:Object = child.type.nativeComponent;

@@ -27,0 +31,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc