Skip to content

Can't reference containers wrapped in a Provider or by connect with Enzyme #1534

Closed
@mordrax

Description

@mordrax

I can't seem to reference anything wrapped in a <Provider> and a connect

// test
let component = shallow(<Provider store={store}><ContainerComponent /></Provider>);
component.find('#abc'); // returns null

let component = shallow(<Provider store={store}><div id="abc"></div></Provider>);
component.find('#abc'); // returns the div node

// ContainerComponent
const Component = ({...}) => (<div id="abc"></div>);
export default connect(..., ...)(Component);

I followed: #1481 to the examples where the tests were written with enzyme, however, the containers are never tested in those. So I don't know whether I should/can test smart containers?

@fshowalter Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions