1- import chai , { expect } from "chai" ;
21import sinon from "sinon" ;
3- import sinonChai from "sinon-chai" ;
42import Draft , { EditorState , SelectionState } from "draft-js" ;
53import adjustBlockDepth from "../adjustBlockDepth" ;
64
7- chai . use ( sinonChai ) ;
8-
95describe ( "adjustBlockDepth" , ( ) => {
106 const createEvent = ( ) => {
117 const e = new window . KeyboardEvent ( "keydown" , { shiftKey : false } ) ;
@@ -44,10 +40,10 @@ describe("adjustBlockDepth", () => {
4440 const event = createEvent ( ) ;
4541 const editorState = createEditorState ( "unstyled" , 0 , 0 ) ;
4642 const newEditorState = adjustBlockDepth ( editorState , event ) ;
47- expect ( newEditorState ) . to . equal ( editorState ) ;
48- expect (
49- Draft . convertToRaw ( newEditorState . getCurrentContent ( ) )
50- ) . to . deep . equal ( rawContentState ( "unstyled" , 0 , 0 ) ) ;
43+ expect ( newEditorState ) . toEqual ( editorState ) ;
44+ expect ( Draft . convertToRaw ( newEditorState . getCurrentContent ( ) ) ) . toEqual (
45+ rawContentState ( "unstyled" , 0 , 0 )
46+ ) ;
5147 } ) ;
5248 } ) ;
5349 [
@@ -60,10 +56,10 @@ describe("adjustBlockDepth", () => {
6056 const event = createEvent ( ) ;
6157 const editorState = createEditorState ( type , 0 , 0 ) ;
6258 const newEditorState = adjustBlockDepth ( editorState , event ) ;
63- expect ( newEditorState ) . not . to . equal ( editorState ) ;
64- expect (
65- Draft . convertToRaw ( newEditorState . getCurrentContent ( ) )
66- ) . to . deep . equal ( rawContentState ( type , 0 , 1 ) ) ;
59+ expect ( newEditorState ) . not . toEqual ( editorState ) ;
60+ expect ( Draft . convertToRaw ( newEditorState . getCurrentContent ( ) ) ) . toEqual (
61+ rawContentState ( type , 0 , 1 )
62+ ) ;
6763 } ) ;
6864 } ) ;
6965 } ) ;
0 commit comments