Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Add default value for blockRenderMap #1302

Conversation

southerncross
Copy link
Contributor

@southerncross southerncross commented Jul 23, 2017

Summary

PR for issue 1211
#1211

Test Plan

no need
Edit by Flarnie: added unit test

Copy link
Contributor

@aadsm aadsm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to submit this PR!
Can you add a "Test Plan" to make sure that Draft works as expected when you only specify blockRenderFn and when you specify both blockRenderFn and blockRenderMap?

Copy link
Contributor

@flarnie flarnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good - could you just add a quick unit test or describe how to manually test it? Thanks! 🌟

@flarnie
Copy link
Contributor

flarnie commented Sep 20, 2017

Would still like to get this fix in - I'll add a quick test based on the example from the issue.

flarnie and others added 3 commits September 20, 2017 23:55
**what is the change?:**
Adding a test for the solution to issue facebookarchive#1211

In general I prefer testing the public API, so we actually render an
example editor and trigger the situation which used to throw an error.

**why make this change?:**
We need better unit tests for Draft, and this will help stop the bug
from recurring if someone randomly removes that check in the future.

**test plan:**
`yarn run test src/component/contents/__tests__/DraftEditorContent.react-test.js`

We tried temporarily undoing the fix and running the test, and verified
that it failed.

**issue:**
facebookarchive#1211
@flarnie
Copy link
Contributor

flarnie commented Sep 20, 2017

Adding this to the queue for merging~✨

@facebook-github-bot
Copy link

@flarnie has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

midas19910709 added a commit to midas19910709/draft-js that referenced this pull request Mar 30, 2022
Summary:
**Summary**

PR for issue 1211
facebookarchive/draft-js#1211

**Test Plan**

<s>no need</s>
**Edit by Flarnie:** added unit test
Closes facebookarchive/draft-js#1302

Reviewed By: zpao

Differential Revision: D5881334

Pulled By: zpao

fbshipit-source-id: b8d57b23a1654fe9cdcf84b74b25617413ef6248
alicayan008 pushed a commit to alicayan008/draft-js that referenced this pull request Jul 4, 2023
Summary:
**Summary**

PR for issue 1211
facebookarchive/draft-js#1211

**Test Plan**

<s>no need</s>
**Edit by Flarnie:** added unit test
Closes facebookarchive/draft-js#1302

Reviewed By: zpao

Differential Revision: D5881334

Pulled By: zpao

fbshipit-source-id: b8d57b23a1654fe9cdcf84b74b25617413ef6248
aforismesen added a commit to aforismesen/draft-js that referenced this pull request Jul 12, 2024
Summary:
**Summary**

PR for issue 1211
facebookarchive/draft-js#1211

**Test Plan**

<s>no need</s>
**Edit by Flarnie:** added unit test
Closes facebookarchive/draft-js#1302

Reviewed By: zpao

Differential Revision: D5881334

Pulled By: zpao

fbshipit-source-id: b8d57b23a1654fe9cdcf84b74b25617413ef6248
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants