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

Function assertPts

test/jasmine/tests/scatter_test.js:1656–1671  ·  view source on GitHub ↗
(attr, getterFn, expectation, msg2)

Source from the content-addressed store, hash-verified

1654 afterEach(destroyGraphDiv);
1655
1656 function assertPts(attr, getterFn, expectation, msg2) {
1657 var selector = attr.indexOf('textfont') === 0 ? '.textpoint > text' : '.point';
1658
1659 d3Select(gd).selectAll('.trace').each(function(_, i) {
1660 var pts = d3Select(this).selectAll(selector);
1661 var expi = expectation[i];
1662
1663 expect(pts.size())
1664 .toBe(expi.length, '# of pts for trace ' + i + msg2);
1665
1666 pts.each(function(_, j) {
1667 var msg3 = ' for pt ' + j + ' in trace ' + i + msg2;
1668 expect(getterFn(this)).toBe(expi[j], attr + msg3);
1669 });
1670 });
1671 }
1672
1673 function makeCheckFn(attr, getterFn) {
1674 return function(update, expectation, msg) {

Callers 1

makeCheckFnFunction · 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…