MCPcopy
hub / github.com/palantir/plottable / verifyMaxEntriesInRow

Function verifyMaxEntriesInRow

test/components/legendTests.ts:186–194  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

184 legend.renderTo(div);
185
186 function verifyMaxEntriesInRow (n: number) {
187 legend.maxEntriesPerRow(n);
188 const rows = legend.content().selectAll<Element, any>(ROW_SELECTOR);
189 assert.strictEqual(rows.size(), (6 / n), "number of rows is correct");
190 rows.each(function(d: any) {
191 const entries = d3.select(this).selectAll<Element, any>(ENTRY_SELECTOR);
192 assert.strictEqual(entries.size(), n, "number of entries in row is correct");
193 });
194 }
195
196 verifyMaxEntriesInRow(1);
197 verifyMaxEntriesInRow(2);

Callers 1

legendTests.tsFile · 0.85

Calls 3

maxEntriesPerRowMethod · 0.80
contentMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected