Skip to content

Commit

Permalink
add more comments for shim and test
Browse files Browse the repository at this point in the history
1. add reason for shim
2. add reason for using jest fake timers
  • Loading branch information
Roy Choo committed Apr 16, 2019
1 parent ff4f021 commit 622d4a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/ra-input-rich-text/src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('RichTextInput', () => {
target: { innerHTML: '<p>test1</p>' }
});

// ensuring the first 'text-change' event had been handled
jest.runOnlyPendingTimers();

rerender(
Expand Down
6 changes: 5 additions & 1 deletion test-setup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
require('raf/polyfill');
require('mutationobserver-shim'); // required due to quilljs
/**
* As jsDom do not support mutationobserver and
* quill requires mutationobserver, thus a shim is needed
* */
require('mutationobserver-shim');
var enzyme = require('enzyme');
var Adapter = require('enzyme-adapter-react-16');

Expand Down

0 comments on commit 622d4a4

Please sign in to comment.