/*
 * Copyright (c) 2019 Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
 */

import { MatRow } from '@angular/material/table';

export class TablePage {
  navigateTo() {
    return cy.visit('/data-table-demo/table-demo');
  }

  getContentToggle(): Cypress.Chainable<JQuery> {
    return cy.get('mat-slide-toggle[id="emptyTableToggle"]');
  }

  getContentToggleStripes(): Cypress.Chainable<JQuery> {
    return cy.get('mat-slide-toggle[id="stripesDirectiveToggle"]');
  }

  getTable(): Cypress.Chainable<JQuery> {
    return cy.get('mat-table');
  }

  getRows(): Cypress.Chainable<JQuery<MatRow>> {
    return this.getTable().find('mat-row');
  }

  getEmptyTableArea(): Cypress.Chainable<JQuery> {
    return cy.get('bci-empty-state');
  }
}
