# 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/manager/tests/e2e/booking/booking-create.spec.ts >> creates a booking for a private customer with insurance
- Location: src/manager/tests/e2e/booking/booking-create.spec.ts:84:7

# Error details

```
Error: expect(locator).toHaveText(expected) failed

Locator: getByTestId('app-page').getByTestId('app-page-content').locator('[data-test-id=app-details-card]:has([data-test-id=title]:has-text("Billing"))').locator('[data-test-id=key-value-item]:has([data-test-id=key]:text-is("Next invoice"))').getByTestId('value')
Timeout: 30000ms
- Expected  - 0
+ Received  + 1

  22 Aug 2026
+ Show preview

Call log:
  - Expect "toHaveText" with timeout 30000ms
  - waiting for getByTestId('app-page').getByTestId('app-page-content').locator('[data-test-id=app-details-card]:has([data-test-id=title]:has-text("Billing"))').locator('[data-test-id=key-value-item]:has([data-test-id=key]:text-is("Next invoice"))').getByTestId('value')
    64 × locator resolved to <td data-v-15a5d3d2="" data-test-id="value" class="col-content pl-1 col-align-top">…</td>
       - unexpected value "22 Aug 2026
Show preview"

```

```yaml
- cell "22 Aug 2026 Show preview":
  - text: 22 Aug 2026
  - link "Show preview":
    - /url: /bookings/721718187715544/upcoming-invoice
```

# Test source

```ts
  1  | import { expect, Locator } from '@playwright/test';
  2  | 
  3  | export async function expectMultiLocatorToHaveText(locator: Locator, text: string[] | undefined): Promise<void> {
  4  |   if (!text) {
  5  |     await expectLocatorToBeEmpty(locator);
  6  |     return;
  7  |   }
  8  | 
  9  |   const expectedValue = RegExp(text.map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'));
  10 | 
  11 |   for (const element of await locator.all()) {
  12 |     await expectSingleLocatorToHaveText(element, expectedValue);
  13 |   }
  14 | }
  15 | 
  16 | export async function expectSingleLocatorToHaveText(
  17 |   locator: Locator,
  18 |   text: string | RegExp | undefined
  19 | ): Promise<void> {
  20 |   text
> 21 |     ? await expect(locator).toHaveText(text, { ignoreCase: true, useInnerText: true })
     |                             ^ Error: expect(locator).toHaveText(expected) failed
  22 |     : await expectLocatorToBeEmpty(locator);
  23 | }
  24 | 
  25 | export async function expectLocatorToBeEmpty(locator: Locator): Promise<void> {
  26 |   await expect(locator).toHaveText(/^(\s*-?\s*)$/);
  27 | }
  28 | 
```