salesforce / salesforce/design-system-react
Allow Modal to be DOM snapshot tested
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 982
- Forks
- 440
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 4
Description
With React Modal 3.71, you can mock ReactDOM.createPortal which DSR Modal uses
https://github.com/reactjs/react-modal/commit/fc53400#diff-bc2c6ca31effc945eed3e8b6a02d0413R14
Here is an example of how to use Jest DOM snapshots with createPortal. https://gist.github.com/505aaron/d5efc2ecc622306cbcc6d3e9c1d7ee9f
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the DSR Modal implementation and its existing tests, then review the linked react-modal commit and snapshot example to understand the intended setup. Done means Modal can be covered by Jest DOM snapshots using the referenced portal behavior, with tests demonstrating the snapshot output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100