{"version":3,"file":"skyux-list-builder-view-grids-testing.mjs","sources":["../../../../../libs/components/list-builder-view-grids/testing/src/legacy/list-view-grid-fixture.ts","../../../../../libs/components/list-builder-view-grids/testing/src/skyux-list-builder-view-grids-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\nimport { SkyListViewGridFixtureCell } from './list-view-grid-fixture-cell';\nimport { SkyListViewGridFixtureHeader } from './list-view-grid-fixture-header';\nimport { SkyListViewGridFixtureRow } from './list-view-grid-fixture-row';\n\n/**\n * Allows interaction with a SKY UX list view grid component.\n * @deprecated\n * @internal\n */\nexport class SkyListViewGridFixture {\n  private debugEl: DebugElement;\n\n  constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n    this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n      fixture,\n      skyTestId,\n      'sky-list-view-grid',\n    );\n  }\n\n  /**\n   * Gets the row at the specified index.\n   * @param index The row's index.\n   */\n  public getRow(index: number): SkyListViewGridFixtureRow {\n    const rowEl = this.getRowEl(index);\n    const cellEls = this.getCellEls(rowEl);\n\n    const rowCells: SkyListViewGridFixtureCell[] = cellEls.map(\n      (cellEl: DebugElement) => {\n        return {\n          el: cellEl,\n          textContent: SkyAppTestUtility.getText(cellEl),\n        };\n      },\n    );\n\n    return {\n      cells: rowCells,\n    };\n  }\n\n  public getRowCount(): number {\n    return this.getRowEls().length;\n  }\n\n  /**\n   * Gets the header at the specified index.\n   * @param columnIndex The index of the column to which the header belongs.\n   */\n  public getHeader(columnIndex: number): SkyListViewGridFixtureHeader {\n    const headerEls = this.getHeaderEls();\n\n    const headerEl = headerEls[columnIndex];\n\n    if (!headerEl) {\n      throw new Error(`No column exists at index ${columnIndex}.`);\n    }\n\n    return {\n      locked: headerEl.nativeElement.classList.contains(\n        'sky-grid-header-locked',\n      ),\n      textContent: SkyAppTestUtility.getText(headerEl),\n    };\n  }\n\n  public getHeaderCount(): number {\n    return this.getHeaderEls().length;\n  }\n\n  private getRowEls(): DebugElement[] {\n    return this.debugEl.queryAll(By.css('.sky-grid-row'));\n  }\n\n  private getRowEl(index: number): DebugElement {\n    const rowEls = this.getRowEls();\n\n    const rowEl = rowEls[index];\n\n    if (!rowEl) {\n      throw new Error(`No row exists at index ${index}.`);\n    }\n\n    return rowEl;\n  }\n\n  private getHeaderEls(): DebugElement[] {\n    return this.debugEl.queryAll(By.css('th.sky-grid-heading > div'));\n  }\n\n  private getCellEls(rowEl: DebugElement): DebugElement[] {\n    return rowEl.queryAll(By.css('.sky-grid-cell sky-grid-cell'));\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AASA;;;;AAIG;MACU,sBAAsB,CAAA;IAGjC,WAAA,CAAY,OAA8B,EAAE,SAAiB,EAAA;AAC3D,QAAA,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,uBAAuB,CACtD,OAAO,EACP,SAAS,EACT,oBAAoB,CACrB;IACH;AAEA;;;AAGG;AACI,IAAA,MAAM,CAAC,KAAa,EAAA;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QAEtC,MAAM,QAAQ,GAAiC,OAAO,CAAC,GAAG,CACxD,CAAC,MAAoB,KAAI;YACvB,OAAO;AACL,gBAAA,EAAE,EAAE,MAAM;AACV,gBAAA,WAAW,EAAE,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC;aAC/C;AACH,QAAA,CAAC,CACF;QAED,OAAO;AACL,YAAA,KAAK,EAAE,QAAQ;SAChB;IACH;IAEO,WAAW,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC,MAAM;IAChC;AAEA;;;AAGG;AACI,IAAA,SAAS,CAAC,WAAmB,EAAA;A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