MCPcopy
hub / github.com/apache/echarts / initTestTitle

Function initTestTitle

test/lib/testHelper.js:356–392  ·  view source on GitHub ↗
(opt, titleContainer, dom)

Source from the content-addressed store, hash-verified

354 };
355
356 function initTestTitle(opt, titleContainer, dom) {
357 var optTitle = opt.title;
358 if (optTitle) {
359 if (optTitle instanceof Array) {
360 optTitle = optTitle.join('\n');
361 }
362 titleContainer.innerHTML = '<div class="test-title-inner">'
363 + encodeHTML(optTitle)
364 .replace(/\*\*([^*]+?)\*\*/g, '<strong>$1</strong>')
365 .replace(/\n/g, '<br>')
366 + '</div>';
367 }
368
369 titleContainer.setAttribute('title', dom.getAttribute('id'));
370 titleContainer.addEventListener('click', function () {
371 // Convenient for locating test case code.
372 console.log('[TEST CASE DOM ID]: ' + dom.getAttribute('id'));
373 });
374
375 var hovering = false;
376 titleContainer.addEventListener('mouseover', function () {
377 if (!hovering) {
378 hovering = true;
379 if (_controlFrameSingleton) {
380 cssAddClass(_controlFrameSingleton.btnPanel, 'control-frame-btn-panel-avoid-occlusion');
381 }
382 }
383 });
384 titleContainer.addEventListener('mouseout', function (event) {
385 if (hovering) {
386 hovering = false;
387 if (_controlFrameSingleton) {
388 cssRemoveClass(_controlFrameSingleton.btnPanel, 'control-frame-btn-panel-avoid-occlusion');
389 }
390 }
391 });
392 }
393
394 function initUpdateInfo(opt, chart, infoContainer) {
395 assert(chart.__testHelper);

Callers 1

testHelper.jsFile · 0.85

Calls 4

encodeHTMLFunction · 0.85
cssAddClassFunction · 0.85
cssRemoveClassFunction · 0.85
addEventListenerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…