import { getStripeInputHost } from '@/manager/shared/utils/locator-utils';
import { BaseComponent } from '@/shared/base/BaseComponent';
import { SepaPaymentSection } from '@/shared/modules/payment-method/components/SepaPaymentSection';
import { SepaPayment } from '@/shared/modules/payment-method/payment-method-types';

export class SepaPaymentMethodAddForm extends BaseComponent {
  readonly sepaPaymentSection = new SepaPaymentSection(getStripeInputHost(this.host, 'Secure payment input frame'));
  readonly checkbox = this.host.getByTestId('accept-terms-checkbox');

  async fill(data: SepaPayment): Promise<void> {
    await this.sepaPaymentSection.fill(data);
    await this.checkbox.click();
  }
}
