Skip to content

Commit b6d19f7

Browse files
committed
Add failing tests.
not defined props must be removed instead of setting them undefined
1 parent 4fa375d commit b6d19f7

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

test/components/connect.spec.js

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -270,53 +270,6 @@ describe('React', () => {
270270
expect('x' in propsAfter).toEqual(false, 'x prop must be removed');
271271
});
272272

273-
it('should remove undefined props without mapDispatchToProps', () => {
274-
// in this failing test connect doesn't call render second time
275-
// i can't understand why
276-
const store = createStore(() => ({}));
277-
let props = { x: true };
278-
let container;
279-
280-
@connect(() => ({}))
281-
class ConnectContainer extends Component {
282-
render() {
283-
return (
284-
<div {...this.props} />
285-
);
286-
}
287-
}
288-
289-
class HolderContainer extends Component {
290-
render() {
291-
return (
292-
<ConnectContainer {...props} />
293-
);
294-
}
295-
}
296-
297-
TestUtils.renderIntoDocument(
298-
<Provider store={store}>
299-
{() => (
300-
<HolderContainer ref={instance => container = instance} />
301-
)}
302-
</Provider>
303-
);
304-
305-
const propsBefore = {
306-
...TestUtils.findRenderedDOMComponentWithTag(container, 'div').props
307-
};
308-
309-
props = {};
310-
container.forceUpdate();
311-
312-
const propsAfter = {
313-
...TestUtils.findRenderedDOMComponentWithTag(container, 'div').props
314-
};
315-
316-
expect(propsBefore.x).toEqual(true);
317-
expect(propsAfter.x).toNotEqual(true);
318-
});
319-
320273
it('should ignore deep mutations in props', () => {
321274
const store = createStore(() => ({
322275
foo: 'bar'

0 commit comments

Comments
 (0)