import { Row } from './row'; import { isNumber } from '../utils'; import Chainable = Cypress.Chainable; export class Cell { constructor(private row: Row, private indexOrId: string | number) {} get element(): Chainable { const row = this.row.element; if (isNumber(this.indexOrId)) { return row.children().eq(this.indexOrId); } return row.children(`[col-id="${this.indexOrId}"]`); } }