@@ -56,30 +56,16 @@ describe('useSlateProps', () => {
5656 expect ( result . current . props . key ) . toBe ( editor . meta . key ) ;
5757
5858 act ( ( ) => {
59+ editor . children = nextValue as any ;
60+ editor . selection = nextSelection ;
5961 result . current . props . onChange ( nextValue as any ) ;
6062 } ) ;
6163
62- expect ( result . current . editorVersion ) . toBe ( 2 ) ;
63- expect ( result . current . selectionVersion ) . toBe ( 1 ) ;
64- expect ( result . current . valueVersion ) . toBe ( 1 ) ;
65- expect ( onChange ) . toHaveBeenCalledWith ( { editor, value : nextValue } ) ;
66-
67- act ( ( ) => {
68- result . current . props . onValueChange ( nextValue as any ) ;
69- } ) ;
70-
71- expect ( result . current . editorVersion ) . toBe ( 2 ) ;
72- expect ( result . current . selectionVersion ) . toBe ( 1 ) ;
73- expect ( result . current . valueVersion ) . toBe ( 2 ) ;
74- expect ( onValueChange ) . toHaveBeenCalledWith ( { editor, value : nextValue } ) ;
75-
76- act ( ( ) => {
77- result . current . props . onSelectionChange ( nextSelection ) ;
78- } ) ;
79-
8064 expect ( result . current . editorVersion ) . toBe ( 2 ) ;
8165 expect ( result . current . selectionVersion ) . toBe ( 2 ) ;
8266 expect ( result . current . valueVersion ) . toBe ( 2 ) ;
67+ expect ( onChange ) . toHaveBeenCalledWith ( { editor, value : nextValue } ) ;
68+ expect ( onValueChange ) . toHaveBeenCalledWith ( { editor, value : nextValue } ) ;
8369 expect ( onSelectionChange ) . toHaveBeenCalledWith ( {
8470 editor,
8571 selection : nextSelection ,
0 commit comments