import { SingleAutocomplete } from '@/manager/shared/components/SingleAutocomplete';
import { BaseComponent } from '@/shared/base/BaseComponent';

export class BookingCreateDiscountPickerTable extends BaseComponent {
  readonly main = this.host.getByTestId('booking-form-discounts');
  readonly discountAutocomplete = new SingleAutocomplete(this.main.getByTestId('content-column-1'));
  readonly addButton = this.main.getByTestId('app-link-button');

  async select(name: string): Promise<void> {
    await this.addButton.click();
    await this.discountAutocomplete.fill(name);
  }
}
