MCPcopy
hub / github.com/plotly/plotly.js / checkAnnotations

Function checkAnnotations

test/jasmine/tests/template_test.js:223–241  ·  view source on GitHub ↗
(layoutCount, coolIndex, schoolIndex, schooly)

Source from the content-addressed store, hash-verified

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

Callers 1

template_test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…