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

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


