(layoutCount, coolIndex, schoolIndex, schooly)
| 221 | |
| 222 | it('makes a new annotation or edits the existing one as necessary', function(done) { |
| 223 | function checkAnnotations(layoutCount, coolIndex, schoolIndex, schooly) { |
| 224 | expect(gd.layout.annotations.length).toBe(layoutCount); |
| 225 | expect(gd._fullLayout.annotations.length).toBe(7); |
| 226 | var annotationElements = document.querySelectorAll('.annotation'); |
| 227 | var coolElement = annotationElements[coolIndex]; |
| 228 | var schoolElement = annotationElements[schoolIndex]; |
| 229 | expect(annotationElements.length).toBe(6); // one hidden |
| 230 | expect(coolElement.textContent).toBe('Be Cool'); |
| 231 | expect(schoolElement.textContent).toBe('Stay in School'); |
| 232 | |
| 233 | if(schooly) { |
| 234 | var schoolItem = gd.layout.annotations[layoutCount - 1]; |
| 235 | expect(schoolItem.templateitemname).toBe('warning2'); |
| 236 | expect(schoolItem.x).toBeWithin(1, 0.001); |
| 237 | expect(schoolItem.y).toBeWithin(schooly, 0.001); |
| 238 | } |
| 239 | |
| 240 | return schoolElement.querySelector('.cursor-pointer'); |
| 241 | } |
| 242 | |
| 243 | var schoolDragger = checkAnnotations(5, 4, 5); |
| 244 |
no outgoing calls
no test coverage detected
searching dependent graphs…