11var Plotly = require ( '@lib/index' ) ;
2- var PlotlyInternal = require ( '@src/plotly ' ) ;
2+ var Registry = require ( '@src/registry ' ) ;
33var Plots = Plotly . Plots ;
44var createGraphDiv = require ( '../assets/create_graph_div' ) ;
55var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
@@ -21,14 +21,14 @@ describe('Plots.executeAPICommand', function() {
2121
2222 describe ( 'with a successful API command' , function ( ) {
2323 beforeEach ( function ( ) {
24- spyOn ( PlotlyInternal , 'restyle' ) . and . callFake ( function ( ) {
24+ spyOn ( Registry . apiMethodRegistry , 'restyle' ) . and . callFake ( function ( ) {
2525 return Promise . resolve ( 'resolution' ) ;
2626 } ) ;
2727 } ) ;
2828
2929 it ( 'calls the API method and resolves' , function ( done ) {
3030 Plots . executeAPICommand ( gd , 'restyle' , [ 'foo' , 'bar' ] ) . then ( function ( value ) {
31- var m = PlotlyInternal . restyle ;
31+ var m = Registry . apiMethodRegistry . restyle ;
3232 expect ( m ) . toHaveBeenCalled ( ) ;
3333 expect ( m . calls . count ( ) ) . toEqual ( 1 ) ;
3434 expect ( m . calls . argsFor ( 0 ) ) . toEqual ( [ gd , 'foo' , 'bar' ] ) ;
@@ -41,14 +41,14 @@ describe('Plots.executeAPICommand', function() {
4141
4242 describe ( 'with an unsuccessful command' , function ( ) {
4343 beforeEach ( function ( ) {
44- spyOn ( PlotlyInternal , 'restyle' ) . and . callFake ( function ( ) {
44+ spyOn ( Registry . apiMethodRegistry , 'restyle' ) . and . callFake ( function ( ) {
4545 return Promise . reject ( 'rejection' ) ;
4646 } ) ;
4747 } ) ;
4848
4949 it ( 'calls the API method and rejects' , function ( done ) {
5050 Plots . executeAPICommand ( gd , 'restyle' , [ 'foo' , 'bar' ] ) . then ( fail , function ( value ) {
51- var m = PlotlyInternal . restyle ;
51+ var m = Registry . apiMethodRegistry . restyle ;
5252 expect ( m ) . toHaveBeenCalled ( ) ;
5353 expect ( m . calls . count ( ) ) . toEqual ( 1 ) ;
5454 expect ( m . calls . argsFor ( 0 ) ) . toEqual ( [ gd , 'foo' , 'bar' ] ) ;
0 commit comments