import Component  from '../component.js'
import CoEuiIconSvg from './eui-icon-svg.js';


export default class CoEuiChip extends Component {
  constructor(parent) {
    let selector = '*[self::eui-chip or self::span[@euiChip] or self::li[@euiChip]]';

    super(parent, selector);
    // https://citnet.tech.ec.europa.eu/CITnet/stash/projects/CSDR/repos/eui/browse/packages/components/eui-chip/eui-chip.component.html
  }
  get wrapper() {
    return this.currentPath + '//div[contains(@class, "eui-chip-wrapper")]';
  }
  get container() {
    return this.wrapper + '//div[contains(@class,"eui-chip__content-container")]';
  }
  get removeIconCO() {
    return new CoEuiIconSvg(this.wrapper).byAttributeContains('class', "eui-chip__remove-icon");
  }
  async isChipRemovable() {
    return await (await $(this.removeIconCO.currentPath)).isExisting();
  }
}


