enzymejs / enzymejs/enzyme

Discussion: Framework "Recommendations"

Open
#472 28 comments 8 reactions 0 assignees View on GitHub
discussion docs
Dominant language
JavaScript
Stars
19.8k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

I think it'd be good to have a discussion to build a doc for our "recommendation" for testing framework wrapped components (redux). This comes up a lot. The real answer is that it's not this libraries scope to handle framework specifics. But it comes up a lot so we should have a discussion about how to handle it.

Personally I think there are a couple good options here:
- A seperate library for making library specific connections easier. e.g., `enzyme-redux`, `enzyme-coflux`, `enzyme-mobx`.
- This would provide helper utilities to make it simple (maybe there are already libraries for this?).
- Docs on our recommendations

As far as docs go. It seems like the easiest recommendation that keeps coming up is to suggest exporting the non-framework-wrapped version of a component.

``` js
export class PrivateComp { }

export const Component = frameworkWrapper(PrivateComponent, ...);
// or
export default frameworkWrapper(PrivateComponent, ...);
```

Looking to hear from the community on how they handle testing framework wrapped components. Extra curious in MobX users as it's got a lot of attention lately.

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests; start by reviewing the 28-comment discussion and the examples for Redux- and MobX-wrapped components. Done would require an agreed recommendation and documentation plan, but the issue does not specify a documentation location or final guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, redux
Domain
documentation, frontend, testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.