@@ -14,8 +14,8 @@ var modeBarButtons = require('../../../src/components/modebar/buttons');
14
14
15
15
var createGraphDiv = require ( '../assets/create_graph_div' ) ;
16
16
var destroyGraphDiv = require ( '../assets/destroy_graph_div' ) ;
17
- var mouseEvent = require ( '../assets/mouse_event' ) ;
18
- var click = require ( '../assets/click' ) ;
17
+ // var mouseEvent = require('../assets/mouse_event');
18
+ // var click = require('../assets/click');
19
19
// var delay = require('../assets/delay');
20
20
// var doubleClick = require('../assets/double_click');
21
21
@@ -42,10 +42,10 @@ describe('Tooltip interactions', function() {
42
42
console . log ( 'Creating graph div and initializing plot...' ) ;
43
43
gd = createGraphDiv ( ) ;
44
44
Plotly . newPlot ( gd , tooltipHeatmapMock . data , tooltipHeatmapMock . layout , tooltipHeatmapMock . config )
45
- . then ( ( ) => {
45
+ . then ( function ( ) {
46
46
console . log ( 'Plot initialized.' ) ;
47
47
done ( ) ;
48
- } ) . catch ( error => {
48
+ } ) . catch ( function ( error ) {
49
49
console . error ( 'Error initializing plot:' , error ) ;
50
50
} ) ;
51
51
} ) ;
@@ -58,7 +58,7 @@ describe('Tooltip interactions', function() {
58
58
it ( 'should enable tooltip on button click' , function ( done ) {
59
59
console . log ( 'Enabling tooltip...' ) ;
60
60
modeBarButtons . tooltip . click ( gd ) ;
61
- setTimeout ( ( ) => {
61
+ setTimeout ( function ( ) {
62
62
console . log ( 'Checking if tooltip has been enabled...' ) ;
63
63
expect ( gd . _fullLayout . _tooltipEnabled ) . toBe ( 'on' ) ;
64
64
expect ( gd . _tooltipClickHandler ) . toBeDefined ( ) ;
@@ -71,8 +71,8 @@ describe('Tooltip interactions', function() {
71
71
console . log ( 'Simulating plot click for tooltip...' ) ;
72
72
gd . emit ( 'plotly_click' , {
73
73
points : [ {
74
- x : 3 ,
75
- y : 4.5 ,
74
+ x : 3 ,
75
+ y : 4.5 ,
76
76
z : 0.9677474816893965 ,
77
77
curveNumber : 0 ,
78
78
pointNumber : [ 9 , 6 ] ,
@@ -81,7 +81,7 @@ describe('Tooltip interactions', function() {
81
81
} ]
82
82
} ) ;
83
83
84
- setTimeout ( ( ) => {
84
+ setTimeout ( function ( ) {
85
85
console . log ( 'Checking if annotation has been created...' ) ;
86
86
expect ( gd . _fullLayout . annotations . length ) . toBe ( 1 ) ;
87
87
var expectedText = 'x: 3.00,<br>y: 4.50,<br>z: 0.968' ;
@@ -95,9 +95,9 @@ describe('Tooltip interactions', function() {
95
95
console . log ( 'Simulating user clearing annotation text...' ) ;
96
96
// Find the specific DOM element or use Plotly's API to simulate the text being cleared
97
97
gd . _fullLayout . annotations [ 0 ] . text = '' ; // Directly setting it for simulation purposes
98
- Plotly . relayout ( gd , { 'annotations[0].text' : '' } ) // Simulate relayout command that might be triggered by UI interaction
98
+ Plotly . relayout ( gd , { 'annotations[0].text' : '' } ) ; // Simulate relayout command that might be triggered by UI interaction
99
99
100
- setTimeout ( ( ) => {
100
+ setTimeout ( function ( ) {
101
101
console . log ( 'Checking if annotation has been removed...' ) ;
102
102
expect ( gd . _fullLayout . annotations . length ) . toBe ( 0 ) ;
103
103
console . log ( 'Annotation successfully removed.' ) ;
@@ -108,7 +108,7 @@ describe('Tooltip interactions', function() {
108
108
it ( 'should deactivate tooltip on button click and stop creating tooltips' , function ( done ) {
109
109
console . log ( 'Deactivating tooltip...' ) ;
110
110
modeBarButtons . tooltip . click ( gd ) ;
111
- setTimeout ( ( ) => {
111
+ setTimeout ( function ( ) {
112
112
expect ( gd . _fullLayout . _tooltipEnabled ) . toBe ( 'off' ) ;
113
113
console . log ( 'Tooltip is deactivated:' , gd . _fullLayout . _tooltipEnabled ) ;
114
114
@@ -125,7 +125,7 @@ describe('Tooltip interactions', function() {
125
125
} ]
126
126
} ) ;
127
127
128
- setTimeout ( ( ) => {
128
+ setTimeout ( function ( ) {
129
129
// Check that no new annotations were added
130
130
expect ( gd . _fullLayout . annotations . length ) . toBe ( 0 ) ;
131
131
console . log ( 'No new annotations created.' ) ;
@@ -134,5 +134,3 @@ describe('Tooltip interactions', function() {
134
134
} , 100 ) ;
135
135
} ) ;
136
136
} ) ;
137
-
138
-
0 commit comments