@@ -32,44 +32,50 @@ describe('<AnnotationRef>', () => {
3232 } ) ;
3333
3434 it ( 'sends update for a[x|y]ref attr on [x|y]ref change' , ( ) => {
35- const onUpdateLayout = jest . fn ( ) ;
35+ const beforeUpdateLayout = jest . fn ( ) ;
3636 const fixtureProps = fixtures . scatter ( {
3737 layout : { annotations : [ { text : 'thor' , ayref : 'y' } ] } ,
3838 } ) ;
39- const drop = render ( { onUpdateLayout, ...fixtureProps } ) . find ( DropdownWidget ) ;
39+ const drop = render ( { beforeUpdateLayout, ...fixtureProps } ) . find (
40+ DropdownWidget
41+ ) ;
4042
4143 drop . prop ( 'onChange' ) ( 'y2' ) ;
4244
43- const { update} = onUpdateLayout . mock . calls [ 0 ] [ 0 ] ;
45+ const { update} = beforeUpdateLayout . mock . calls [ 0 ] [ 0 ] ;
4446 expect ( update ) . toEqual ( {
4547 'annotations[0].ayref' : 'y2' ,
4648 'annotations[0].yref' : 'y2' ,
4749 } ) ;
4850 } ) ;
4951
5052 it ( 'does not send update for a[x|y]ref attr on "paper" change' , ( ) => {
51- const onUpdateLayout = jest . fn ( ) ;
53+ const beforeUpdateLayout = jest . fn ( ) ;
5254 const fixtureProps = fixtures . scatter ( {
5355 layout : { annotations : [ { text : 'thor' , ayref : 'y' } ] } ,
5456 } ) ;
55- const drop = render ( { onUpdateLayout, ...fixtureProps } ) . find ( DropdownWidget ) ;
57+ const drop = render ( { beforeUpdateLayout, ...fixtureProps } ) . find (
58+ DropdownWidget
59+ ) ;
5660
5761 drop . prop ( 'onChange' ) ( 'paper' ) ;
58- const { update} = onUpdateLayout . mock . calls [ 0 ] [ 0 ] ;
62+ const { update} = beforeUpdateLayout . mock . calls [ 0 ] [ 0 ] ;
5963 expect ( update ) . toEqual ( {
6064 'annotations[0].yref' : 'paper' ,
6165 } ) ;
6266 } ) ;
6367
6468 it ( 'does not send update for a[x|y]ref when a[x|y]ref is pixel' , ( ) => {
65- const onUpdateLayout = jest . fn ( ) ;
69+ const beforeUpdateLayout = jest . fn ( ) ;
6670 const fixtureProps = fixtures . scatter ( {
6771 layout : { annotations : [ { text : 'thor' , yref : 'y' , ayref : 'pixel' } ] } ,
6872 } ) ;
69- const drop = render ( { onUpdateLayout, ...fixtureProps } ) . find ( DropdownWidget ) ;
73+ const drop = render ( { beforeUpdateLayout, ...fixtureProps } ) . find (
74+ DropdownWidget
75+ ) ;
7076
7177 drop . prop ( 'onChange' ) ( 'y2' ) ;
72- const { update} = onUpdateLayout . mock . calls [ 0 ] [ 0 ] ;
78+ const { update} = beforeUpdateLayout . mock . calls [ 0 ] [ 0 ] ;
7379 expect ( update ) . toEqual ( {
7480 'annotations[0].yref' : 'y2' ,
7581 } ) ;
0 commit comments