()
| 1122 | // for annotations with arrows: check that dragging the text moves only |
| 1123 | // ax and ay (and the textbox itself) |
| 1124 | function checkTextDrag() { |
| 1125 | var ann = gd.layout.annotations[0]; |
| 1126 | var x0 = ann.x; |
| 1127 | var y0 = ann.y; |
| 1128 | var ax0 = ann.ax; |
| 1129 | var ay0 = ann.ay; |
| 1130 | |
| 1131 | var bboxInitial = textBox().getBoundingClientRect(); |
| 1132 | |
| 1133 | return dragAndReplot(textDrag(), 50, -50) |
| 1134 | .then(function() { |
| 1135 | var bbox = textBox().getBoundingClientRect(); |
| 1136 | expect(bbox.left).toBeWithin(bboxInitial.left + 50, 1); |
| 1137 | expect(bbox.top).toBeWithin(bboxInitial.top - 50, 1); |
| 1138 | |
| 1139 | ann = gd.layout.annotations[0]; |
| 1140 | |
| 1141 | expect(ann.x).toBe(x0); |
| 1142 | expect(ann.y).toBe(y0); |
| 1143 | expect(ann.ax).toBeWithin(ax0 + 50, 1); |
| 1144 | expect(ann.ay).toBeWithin(ay0 - 50, 1); |
| 1145 | }); |
| 1146 | } |
| 1147 | |
| 1148 | it('respects anchor: auto when paper-referenced without arrow', function(done) { |
| 1149 | makePlot([{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…