(objectColor, arrowColor, moveX, moveY, corner)
| 101 | |
| 102 | // Tests moving the whole annotation |
| 103 | function testAnnotationMoveWhole(objectColor, arrowColor, moveX, moveY, corner) { |
| 104 | var bboxAfter; |
| 105 | var arrowBBoxAfter; |
| 106 | // Get where the text box (label) is before dragging it |
| 107 | var bboxBefore = getSVGElemScreenBBox( |
| 108 | domainRefComponents.findAROByColor(objectColor, undefined, 'rect') |
| 109 | ); |
| 110 | var arrowBBoxBefore = getSVGElemScreenBBox( |
| 111 | domainRefComponents.findAROByColor(arrowColor, undefined, 'path', 'fill') |
| 112 | ); |
| 113 | var optArrowDrag = { |
| 114 | pos0: dragPos0(arrowBBoxBefore, corner) |
| 115 | }; |
| 116 | optArrowDrag.dpos = [moveX, moveY]; |
| 117 | // console.log('optArrowDrag', optArrowDrag); |
| 118 | // drag the whole annotation |
| 119 | (new Promise(function(resolve) { |
| 120 | drag(optArrowDrag); resolve(); |
| 121 | })) |
| 122 | .then(delay(DELAY_TIME)) |
| 123 | .then(function() { |
| 124 | // check the new position of the arrow and label |
| 125 | arrowBBoxAfter = getSVGElemScreenBBox( |
| 126 | domainRefComponents.findAROByColor(arrowColor, undefined, 'path', 'fill') |
| 127 | ); |
| 128 | bboxAfter = getSVGElemScreenBBox( |
| 129 | domainRefComponents.findAROByColor(objectColor, undefined, 'rect') |
| 130 | ); |
| 131 | checkBBox(arrowBBoxBefore, arrowBBoxAfter, moveX, moveY); |
| 132 | checkBBox(bboxBefore, bboxAfter, moveX, moveY); |
| 133 | }) |
| 134 | .then(delay(DELAY_TIME)); |
| 135 | } |
| 136 | |
| 137 | describe('Shapes referencing domain', function() { |
| 138 | var gd; |
no test coverage detected
searching dependent graphs…