MCPcopy Create free account
hub / github.com/cli-table/cli-table3 / checkExpectation

Function checkExpectation

test/table-layout-test.js:386–410  ·  view source on GitHub ↗
(actualCell, expectedCell, x, y, actualTable)

Source from the content-addressed store, hash-verified

384 }
385
386 function checkExpectation(actualCell, expectedCell, x, y, actualTable) {
387 if (typeof expectedCell === 'string') {
388 expectedCell = { content: expectedCell };
389 }
390 if (Object.prototype.hasOwnProperty.call(expectedCell, 'content')) {
391 expect(actualCell).toBeInstanceOf(Cell);
392 expect(actualCell.content).toEqual(expectedCell.content);
393 }
394 if (Object.prototype.hasOwnProperty.call(expectedCell, 'rowSpan')) {
395 expect(actualCell).toBeInstanceOf(Cell);
396 expect(actualCell.rowSpan).toEqual(expectedCell.rowSpan);
397 }
398 if (Object.prototype.hasOwnProperty.call(expectedCell, 'colSpan')) {
399 expect(actualCell).toBeInstanceOf(Cell);
400 expect(actualCell.colSpan).toEqual(expectedCell.colSpan);
401 }
402 if (Object.prototype.hasOwnProperty.call(expectedCell, 'spannerFor')) {
403 expect(actualCell).toBeInstanceOf(Cell.RowSpanCell);
404 expect(actualCell.originalCell).toBeInstanceOf(Cell);
405 expect(actualCell.originalCell).toEqual(
406 findCell(actualTable, expectedCell.spannerFor[1], expectedCell.spannerFor[0])
407 );
408 //TODO: retest here x,y coords
409 }
410 }
411});

Callers 1

checkLayoutFunction · 0.85

Calls 1

findCellFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…