Skip to content

Commit 1893a1a

Browse files
noahlemenflarnie
authored andcommitted
Test that getDecorations is called with correct arguments (facebookarchive#995)
* add EditorState test that checks `getDecorations calls` for correct argument order * lint fix, remove unnecessary var
1 parent b076d7b commit 1893a1a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/model/immutable/__tests__/EditorState-test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,15 @@ describe('EditorState', () => {
299299
);
300300
});
301301

302+
it('must call decorator with correct argument types and order', () => {
303+
var decorator = new Decorator();
304+
getDecoratedEditorState(decorator);
305+
decorator.getDecorations.mock.calls.forEach((call) => {
306+
expect(call[0] instanceof ContentBlock).toBe(true);
307+
expect(call[1] instanceof ContentState).toBe(true);
308+
});
309+
});
310+
302311
it('must correctly remove a decorator', () => {
303312
var decorator = new Decorator();
304313
var editorState = getDecoratedEditorState(decorator);

0 commit comments

Comments
 (0)