salesforce / salesforce/design-system-react

Allow Modal to be DOM snapshot tested

Open
#2,095 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app-launcher date-picker global-navigation-bar modal panel scale and productivity
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.