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

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

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