import * as React from 'react';
import CollapsedPayment from './CollapsedPayment';
import BaseDriver from '../../../test/BaseDriver';

export default class CashierPaymentsDriver extends BaseDriver {
  component: any;

  when = {
    render: () => {
      this.component = this._render(<CollapsedPayment
        iconName="visa"
        title="someTitle"
      />);
      return this;
    },
  };

  has = {
    root: () => this.get.root().exists(),
    title: () => this.get.root().text().indexOf('someTitle') !== -1,
    icon: () => this.get.root().find('img').length === 1,
  };

  get = {
    root: () => this.findByDataHook(`wcn-collapsed-payment`),
  };
}
