import Component from '../../component.js'
import { elementAttributeContains } from '../../../core/utils.js'

export default class CoEuiInputCheckbox extends Component {
    constructor(parent) {
      let selector = 'input[@euiInputCheckBox]' ;
      super(parent, selector);
      // https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-input-checkbox/eui-input-checkbox.component.ts
    }
    async hasNoLabel() {
      return await elementAttributeContains(this.currentPath, 'class', 'eui-input-checkbox--nolabel');
    }
    async isInvalid() {
      return await elementAttributeContains(this.currentPath, 'class', 'eui-input-checkbox--invalid');
    }
    async isDisabled() {
      return await elementAttributeContains(this.currentPath, 'class', 'eui-input-checkbox--disabled');
    }
    async isChecked() {
      return await (await $(this.currentPath + '/self::input[@checked="true"]')).isExisting();
    }
    async isReadOnly() {
      return await (await $(this.currentPath + '/self::input[@readonly]')).isExisting();
    }
}


