# Instructions

- Following Playwright test failed.
- Explain why, be concise, respect Playwright best practices.
- Provide a snippet of code with the fix, if possible.

# Test info

- Name: src/portal/tests/e2e/booking/booking-create.spec.ts >> shows the correct basket for a private customer with a weekly plan, no insurance, a multiple-months discount and a move-in date 5 days in the future
- Location: src/portal/tests/e2e/booking/booking-create.spec.ts:123:7

# Error details

```
Error: expect(locator).toBeHidden() failed

Locator:  getByTestId('basket-content-modal').getByTestId('summary-recurring-payment').getByTestId('summary-aside').getByTestId('old-price')
Expected: hidden
Received: visible
Timeout:  30000ms

Call log:
  - Expect "toBeHidden" with timeout 30000ms
  - waiting for getByTestId('basket-content-modal').getByTestId('summary-recurring-payment').getByTestId('summary-aside').getByTestId('old-price')
    64 × locator resolved to <span data-test-id="old-price" class="text-min font-normal line-through text-gray-700">€2,964.00</span>
       - unexpected value "visible"

```

```yaml
- text: €2,964.00
```

# Test source

```ts
  22  |   isMobile: boolean,
  23  |   customerType: CustomerType,
  24  |   moveInDate: Date,
  25  |   location: Location,
  26  |   unitType: BookingCreateUnitType,
  27  |   insurance?: BookingCreateInsurance,
  28  |   discount?: BookingCreateDiscount
  29  | ): Promise<void> {
  30  |   const unitTypePriceExclVat = unitType.billing.price * unitType.billing.amount;
  31  |   const unitTypePriceDiscounted =
  32  |     discount &&
  33  |     (discount.type === 'fixed'
  34  |       ? unitTypePriceExclVat - discount.value
  35  |       : decreaseByPercentage(unitTypePriceExclVat, discount.value));
  36  |   const unitTypeTaxRate = customerType === 'private' ? unitType.taxes.b2c.rate : unitType.taxes.b2b.rate;
  37  |   const unitTypePriceInclVat = increaseByPercentage(unitTypePriceExclVat, unitTypeTaxRate);
  38  |   const unitTypePriceInclVatDiscounted =
  39  |     unitTypePriceDiscounted && increaseByPercentage(unitTypePriceDiscounted, unitTypeTaxRate);
  40  |   const insurancePriceExclVat = insurance && insurance.billing.price * insurance.billing.amount;
  41  |   const insuranceTaxRate =
  42  |     insurance && (customerType === 'private' ? insurance.taxes.b2c.rate : insurance.taxes.b2b.rate);
  43  |   const insurancePriceInclVat =
  44  |     insurancePriceExclVat && increaseByPercentage(insurancePriceExclVat, insuranceTaxRate ?? 0);
  45  |   const totalPrice = unitTypePriceInclVat + (insurancePriceInclVat ?? 0);
  46  |   const totalPriceDiscounted =
  47  |     unitTypePriceInclVatDiscounted && unitTypePriceInclVatDiscounted + (insurancePriceInclVat ?? 0);
  48  |   const recurringPaymentPrice = totalPrice;
  49  |   let recurringPaymentPriceDiscounted: number | undefined = undefined;
  50  | 
  51  |   if (discount) {
  52  |     if (discount.duration.option === 'multiple_months' && discount.duration.amount) {
  53  |       const billingEndDate = dayjs(moveInDate).add(
  54  |         unitType.billing.amount,
  55  |         unitType.billing.type === 'weekly' ? 'weeks' : 'months'
  56  |       );
  57  |       const discountEndDate = dayjs(moveInDate).add(discount.duration.amount, 'months');
  58  | 
  59  |       if (discountEndDate.isAfter(billingEndDate)) {
  60  |         recurringPaymentPriceDiscounted = totalPriceDiscounted;
  61  |       }
  62  |     } else if (discount.duration.option === 'forever') {
  63  |       recurringPaymentPriceDiscounted = totalPriceDiscounted;
  64  |     }
  65  |   }
  66  | 
  67  |   if (isMobile) {
  68  |     await expect(basketContent.location).toBeHidden();
  69  |   } else {
  70  |     await expect(basketContent.location).toBeVisible();
  71  |     await expect(basketContent.locationName).toHaveText(location.name);
  72  |     await expect(basketContent.locationAddress).toHaveText(
  73  |       formatAddressWithoutCountry(location.street, location.postalCode, location.city)
  74  |     );
  75  |   }
  76  | 
  77  |   await expect(basketContent.moveInDateValue).toHaveText(formatDateLegacy(moveInDate));
  78  |   await expect(basketContent.unitTypeName).toHaveText(unitType.name);
  79  |   await expect(basketContent.unitTypePriceInclVat).toHaveText(formatCurrency(unitTypePriceInclVat, location.currency));
  80  | 
  81  |   if (insurancePriceInclVat) {
  82  |     await expect(basketContent.insuranceName).toHaveText(insurance.name);
  83  |     await expect(basketContent.insurancePriceInclVat).toHaveText(
  84  |       formatCurrency(insurancePriceInclVat, location.currency)
  85  |     );
  86  |   } else {
  87  |     await expect(basketContent.insuranceName).toBeHidden();
  88  |     await expect(basketContent.insurancePriceInclVat).toBeHidden();
  89  |   }
  90  | 
  91  |   if (discount) {
  92  |     await expect(basketContent.discountCodeForm.discountTerms).toHaveText(
  93  |       formatDiscount(
  94  |         discount.duration,
  95  |         discount.type === 'percentage'
  96  |           ? formatPercentage(discount.value)
  97  |           : formatCurrency(discount.value, location.currency)
  98  |       )
  99  |     );
  100 |   } else {
  101 |     await expect(basketContent.discountCodeForm.discountTerms).toBeHidden();
  102 |   }
  103 | 
  104 |   if (totalPriceDiscounted) {
  105 |     await expect(basketContent.firstInvoiceOldPriceInclVat).toHaveText(formatCurrency(totalPrice, location.currency));
  106 |     await expect(basketContent.firstInvoiceNewPriceInclVat).toHaveText(
  107 |       formatCurrency(totalPriceDiscounted, location.currency)
  108 |     );
  109 |   } else {
  110 |     await expect(basketContent.firstInvoiceOldPriceInclVat).toBeHidden();
  111 |     await expect(basketContent.firstInvoiceNewPriceInclVat).toHaveText(formatCurrency(totalPrice, location.currency));
  112 |   }
  113 | 
  114 |   if (recurringPaymentPriceDiscounted) {
  115 |     await expect(basketContent.recurringPaymentOldPriceInclVat).toHaveText(
  116 |       formatCurrency(recurringPaymentPrice, location.currency)
  117 |     );
  118 |     await expect(basketContent.recurringPaymentNewPriceInclVat).toHaveText(
  119 |       formatCurrency(recurringPaymentPriceDiscounted, location.currency)
  120 |     );
  121 |   } else {
> 122 |     await expect(basketContent.recurringPaymentOldPriceInclVat).toBeHidden();
      |                                                                 ^ Error: expect(locator).toBeHidden() failed
  123 |     await expect(basketContent.recurringPaymentNewPriceInclVat).toHaveText(
  124 |       formatCurrency(recurringPaymentPrice, location.currency)
  125 |     );
  126 |   }
  127 | }
  128 | 
```