(actualCell, expectedCell, x, y, actualTable)
| 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 | }); |
no test coverage detected
searching dependent graphs…