# 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-adjustment.spec.ts >> schedules a booking plan switch for the period end
- Location: src/manager/tests/e2e/booking/booking-adjustment.spec.ts:28:7

# Error details

```
Test timeout of 240000ms exceeded.
```

```
Error: locator.waitFor: Test timeout of 240000ms exceeded.
Call log:
  - waiting for locator('.v-snackbar').filter({ hasText: 'Booking successfully adjusted' }).or(locator('.v-snackbar').filter({ hasText: 'The current data was updated somewhere else and does not reflect the current state. Please reload this window and try again.' })) to be visible

```

# Page snapshot

```yaml
- generic [ref=e1]:
  - generic [ref=e6]:
    - navigation [ref=e7]:
      - generic [ref=e9]:
        - link [ref=e10] [cursor=pointer]:
          - /url: /
        - generic [ref=e11]:
          - generic [ref=e12]: KINNOVIS
          - generic [ref=e13]: Manager
        - button [ref=e15] [cursor=pointer]
      - list [ref=e19]:
        - generic [ref=e21]: Dashboard
        - link "Tasks" [ref=e23] [cursor=pointer]:
          - /url: /tasks
        - link "Facility maps" [ref=e30] [cursor=pointer]:
          - /url: /facility-map
          - generic [ref=e31]: 󰧾
        - link "Analytics" [ref=e35] [cursor=pointer]:
          - /url: /dashboard
          - generic [ref=e36]: 󱖶
        - generic [ref=e40]: Sales
        - link "Bookings" [ref=e42] [cursor=pointer]:
          - /url: /bookings
          - generic [ref=e43]: 󰇡
        - link "Customers" [ref=e47] [cursor=pointer]:
          - /url: /customers
          - generic [ref=e48]: 󰀏
        - link "Invoices" [ref=e52] [cursor=pointer]:
          - /url: /invoices
          - generic [ref=e53]: 󰷉
        - link "Credit notes" [ref=e57] [cursor=pointer]:
          - /url: /credit-notes
        - link "Units" [ref=e64] [cursor=pointer]:
          - /url: /units
          - generic [ref=e65]: 󰍀
        - generic [ref=e69]: Site management
        - link "Locations" [ref=e71] [cursor=pointer]:
          - /url: /locations
          - generic [ref=e72]: 󰟙
        - link "Unit types" [ref=e76] [cursor=pointer]:
          - /url: /unit-types
          - generic [ref=e77]: 󰆧
        - link "Protection Plans" [ref=e81] [cursor=pointer]:
          - /url: /insurances
          - generic [ref=e82]: 󰳌
        - link "Deposits" [ref=e86] [cursor=pointer]:
          - /url: /deposits
          - generic [ref=e87]: 󱙆
        - link "Products" [ref=e91] [cursor=pointer]:
          - /url: /products
          - generic [ref=e92]: 󰄑
        - link "Discounts" [ref=e96] [cursor=pointer]:
          - /url: /discounts
          - generic [ref=e97]: 󰓼
        - generic [ref=e101]:
          - option "Emails" [ref=e102] [cursor=pointer]:
            - generic [ref=e103]: 󰻨
            - generic [ref=e107]: 󰅀
          - text: 󱡰 󰁥
        - link "Document templates" [ref=e111] [cursor=pointer]:
          - /url: /document-templates
          - generic [ref=e112]: 󰷉
        - generic [ref=e116]: Admin
        - link "Integrations" [ref=e118] [cursor=pointer]:
          - /url: /connected-apps
          - generic [ref=e119]: 󱘖
        - link "User & Roles" [ref=e123] [cursor=pointer]:
          - /url: /users
          - generic [ref=e124]: 󰭘
        - generic [ref=e128]:
          - option "Booking Portal" [ref=e129] [cursor=pointer]:
            - generic [ref=e130]: 󱃁
            - generic [ref=e134]: 󰅀
          - text: 󰖟 󰟙
        - generic [ref=e138]:
          - option "JaneAI" [ref=e139] [cursor=pointer]:
            - generic [ref=e140]: 󱙺
            - generic [ref=e144]: 󰅀
          - text: 󱜹
        - generic [ref=e148]: Feedback
        - link "Voting Portal" [ref=e150] [cursor=pointer]:
          - /url: /voting-portal
          - generic [ref=e151]: 󰔔
      - generic [ref=e157]:
        - button "AS Andreas Stadler andreas.stadler@storeroom.at" [ref=e160] [cursor=pointer]:
          - generic [ref=e161]: AS
          - generic [ref=e164]:
            - generic [ref=e165]: Andreas Stadler
            - generic "andreas.stadler@storeroom.at" [ref=e166]
          - generic [ref=e167]: 󰇙
          - generic: 󰗊 󰅀 󰷖 󰍃
        - button [ref=e168] [cursor=pointer]:
          - generic [ref=e169]: 󰋽
    - main [ref=e171]:
      - generic [ref=e173]:
        - generic [ref=e175]:
          - generic [ref=e176]:
            - link "Bookings" [ref=e177] [cursor=pointer]:
              - /url: /bookings
            - generic [ref=e179]: 󰅂
            - generic [ref=e180]: Booking 9829-2583-4516-913
            - generic [ref=e181]: Active
          - button [ref=e186] [cursor=pointer]:
            - generic [ref=e187]:
              - text: Actions
              - generic [ref=e188]: 󱨉
            - generic: 󱕂
        - generic [ref=e190]:
          - generic [ref=e191]:
            - generic [ref=e193]:
              - heading "General" [level=3] [ref=e197]
              - table [ref=e200]:
                - rowgroup [ref=e201]:
                  - row [ref=e202]:
                    - rowheader "Customer" [ref=e203]
                    - cell [ref=e204]:
                      - link "Delpha Hamill" [ref=e207] [cursor=pointer]:
                        - /url: /customers/1107898074
                  - row [ref=e210]:
                    - rowheader "Location" [ref=e211]
                    - cell [ref=e212]:
                      - link "Vienna South" [ref=e215] [cursor=pointer]:
                        - /url: /locations/5000500050
                  - row [ref=e218]:
                    - rowheader "Created at" [ref=e219]
                    - cell "27 Aug 2026" [ref=e220]
                  - row [ref=e223]:
                    - rowheader "Move-in" [ref=e224]
                    - cell "27 Aug 2026" [ref=e225]
                  - row [ref=e228]:
                    - rowheader "Move-out" [ref=e229]
                    - cell "-" [ref=e230]
                  - row [ref=e233]:
                    - rowheader "Cancelled at" [ref=e234]
                    - cell "-" [ref=e235]
                  - row [ref=e238]:
                    - rowheader "Deposit excl. VAT" [ref=e239]
                    - cell "-" [ref=e240]
                  - row [ref=e243]:
                    - rowheader "Discount" [ref=e244]
                    - cell "-" [ref=e245]
                  - row [ref=e248]:
                    - rowheader "Contract" [ref=e249]
                    - cell "-" [ref=e250]
            - generic [ref=e253]:
              - generic [ref=e254]:
                - heading "Billing" [level=3] [ref=e258]
                - table [ref=e261]:
                  - rowgroup [ref=e262]:
                    - row [ref=e263]:
                      - rowheader "Booking Plan" [ref=e264]
                      - cell "Basic (1 week)" [ref=e265]
                    - row [ref=e268]:
                      - rowheader "Current period" [ref=e269]
                      - cell "27 Aug - 3 Sep 2026" [ref=e270]
                    - row [ref=e273]:
                      - rowheader "Amount excl. VAT" [ref=e274]
                      - cell "€50.00" [ref=e275]
                    - row [ref=e278]:
                      - rowheader "Price adjustment" [ref=e279]
                      - cell "-" [ref=e280]
                    - row [ref=e283]:
                      - rowheader "Next invoice" [ref=e284]
                      - cell "3 Sep 2026 Show preview" [ref=e285]:
                        - generic [ref=e286]:
                          - generic [ref=e287]: 3 Sep 2026
                          - link "Show preview" [ref=e289] [cursor=pointer]:
                            - /url: /bookings/982925834516913/upcoming-invoice
                            - generic [ref=e290]: 󰛐
                    - row [ref=e293]:
                      - rowheader "Payment method" [ref=e294]
                      - cell "-" [ref=e295]
                    - row [ref=e298]:
                      - rowheader "Payment option" [ref=e299]
                      - cell "Automatic payment through Stripe" [ref=e300]
              - generic [ref=e303]:
                - generic [ref=e305]:
                  - heading "Notes" [level=3] [ref=e307]
                  - link [ref=e309] [cursor=pointer]:
                    - /url: /bookings/982925834516913/edit/notes
                    - generic [ref=e310]: 󰲶
                - table [ref=e314]:
                  - rowgroup [ref=e315]:
                    - row [ref=e316]:
                      - rowheader "Note" [ref=e317]
                      - cell "-" [ref=e318]
          - generic [ref=e321]:
            - heading "Items" [level=3] [ref=e325]
            - generic [ref=e328]:
              - generic [ref=e329]:
                - generic [ref=e330]:
                  - link "Handcrafted Box GdlSyz" [ref=e331] [cursor=pointer]:
                    - /url: /unit-types/2017607032
                  - text: /
                  - link "Unit hsChC2" [ref=e334] [cursor=pointer]:
                    - /url: /units/136788805
                - generic [ref=e337]: €50.00
              - generic [ref=e338]:
                - generic [ref=e339]:
                  - strong [ref=e340]: Total excl. VAT
                  - strong [ref=e341]: €50.00
                - generic [ref=e342]:
                  - generic [ref=e343]: VAT
                  - generic [ref=e344]: €8.50
                - generic [ref=e345]:
                  - strong [ref=e346]: Total incl. VAT
                  - strong [ref=e347]: €58.50
          - generic [ref=e348]:
            - heading "Invoices" [level=3] [ref=e352]
            - generic [ref=e356]:
              - generic [ref=e358]:
                - generic [ref=e360]:
                  - button "Select all" [ref=e368] [cursor=pointer]:
                    - generic [ref=e369]: 󰄬
                  - generic [ref=e372]:
                    - button "Mark as paid" [disabled] [ref=e375]:
                      - generic [ref=e376]: 󰗡
                    - button "SEPA XML actions" [disabled] [ref=e381]:
                      - generic [ref=e382]: 󱨉
                      - generic: 󰗡 󰅚 󰗖
                    - generic [ref=e387]:
                      - button [ref=e388] [cursor=pointer]
                      - generic: 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲
                - table [ref=e394]:
                  - rowgroup [ref=e395]:
                    - row [ref=e396]:
                      - columnheader [ref=e397]:
                        - generic [ref=e398]:
                          - checkbox [ref=e399]
                          - generic [ref=e400] [cursor=pointer]: 󰄱
                      - columnheader [ref=e402]:
                        - button "Number" [ref=e403] [cursor=pointer]:
                          - generic [ref=e406]: 󰁝
                      - columnheader [ref=e409]:
                        - button "Status" [ref=e410] [cursor=pointer]:
                          - generic [ref=e413]: 󰁝
                      - columnheader [ref=e416]:
                        - button "Payment option" [ref=e417] [cursor=pointer]:
                          - generic [ref=e420]: 󰁝
                      - columnheader [ref=e423]:
                        - button "Due date" [ref=e424] [cursor=pointer]:
                          - generic [ref=e427]: 󰁝
                      - columnheader [ref=e430]:
                        - button "Unit" [ref=e431] [cursor=pointer]:
                          - generic [ref=e434]: 󰁝
                      - columnheader "Discount" [ref=e437]
                      - columnheader [ref=e441]:
                        - button "Total (incl. VAT)" [ref=e442] [cursor=pointer]:
                          - generic [ref=e443]:
                            - generic [ref=e444]: Total (incl. VAT)
                            - generic [ref=e445]: 󰋽
                          - generic [ref=e447]: 󰁝
                      - columnheader [ref=e450]:
                        - button "Amount due" [ref=e451] [cursor=pointer]:
                          - generic [ref=e454]: 󰁝
                      - columnheader [ref=e457]:
                        - button "Issue date" [ref=e458] [cursor=pointer]:
                          - generic [ref=e461]: 󰁝
                      - columnheader "Actions" [ref=e464]
                    - row [ref=e468]:
                      - columnheader [ref=e469]
                  - rowgroup [ref=e470]:
                    - row [ref=e471]:
                      - cell [ref=e472]:
                        - generic [ref=e473]:
                          - checkbox [ref=e474]
                          - generic [ref=e475] [cursor=pointer]: 󰄱
                      - cell [ref=e477]:
                        - link "INV-2120876" [ref=e478] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e480]:
                        - link "Open" [ref=e481] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e486]:
                        - link "Manual" [ref=e487] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e489]:
                        - link "29 Aug 2026" [ref=e490] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e492]:
                        - link [ref=e493] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell "-" [ref=e494]
                      - cell [ref=e496]:
                        - link "€58.50" [ref=e497] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e499]:
                        - link "€58.50" [ref=e500] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e502]:
                        - link "27 Aug 2026" [ref=e503] [cursor=pointer]:
                          - /url: /invoices/1897288207
                      - cell [ref=e505]:
                        - button [ref=e508] [cursor=pointer]:
                          - generic [ref=e509]: 󰇘
                          - generic: 󰇚 󰯝
              - generic [ref=e513]:
                - generic [ref=e514]:
                  - generic [ref=e515]: "Items per page:"
                  - combobox [ref=e518]:
                    - generic [ref=e520] [cursor=pointer]:
                      - generic [ref=e521]: "10"
                      - combobox "Items per page:": "10"
                    - generic [ref=e523]: 󰍝
                - generic [ref=e525]: 1-1 of 1
                - generic [ref=e526]:
                  - button [disabled]:
                    - generic: 󰘀
                  - button [disabled]:
                    - generic: 󰅁
                  - button [disabled]:
                    - generic: 󰅂
                  - button [disabled]:
                    - generic: 󰘁
          - generic [ref=e527]:
            - heading "Payments" [level=3] [ref=e531]
            - generic [ref=e535]:
              - table [ref=e539]:
                - rowgroup [ref=e540]:
                  - row [ref=e541]:
                    - columnheader [ref=e542]:
                      - button "Total" [ref=e543] [cursor=pointer]:
                        - generic [ref=e546]: 󰁝
                    - columnheader [ref=e549]:
                      - button "Status" [ref=e550] [cursor=pointer]:
                        - generic [ref=e553]: 󰁝
                    - columnheader [ref=e556]:
                      - button "Invoice no." [ref=e557] [cursor=pointer]:
                        - generic [ref=e560]: 󰁝
                    - columnheader [ref=e563]:
                      - button "Date" [ref=e564] [cursor=pointer]:
                        - generic [ref=e567]: 󰁝
                    - columnheader [ref=e570]:
                      - button "Payment method" [ref=e571] [cursor=pointer]:
                        - generic [ref=e574]: 󰁝
                  - row [ref=e577]:
                    - columnheader [ref=e578]
                - rowgroup [ref=e579]:
                  - row [ref=e580]:
                    - cell "€58.50" [ref=e581]
                    - cell "Not paid yet" [ref=e583]
                    - cell "INV-2120876" [ref=e588]
                    - cell "27 Aug 2026" [ref=e590]
                    - cell [ref=e592]
              - generic [ref=e595]:
                - generic [ref=e596]:
                  - generic [ref=e597]: "Items per page:"
                  - combobox [ref=e600]:
                    - generic [ref=e602] [cursor=pointer]:
                      - generic [ref=e603]: "10"
                      - combobox "Items per page:": "10"
                    - generic [ref=e605]: 󰍝
                - generic [ref=e607]: 1-1 of 1
                - generic [ref=e608]:
                  - button [disabled]:
                    - generic: 󰘀
                  - button [disabled]:
                    - generic: 󰅁
                  - button [disabled]:
                    - generic: 󰅂
                  - button [disabled]:
                    - generic: 󰘁
  - generic:
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - dialog:
      - generic [ref=e611]:
        - generic [ref=e612]:
          - generic [ref=e614]:
            - generic [ref=e615]:
              - button [ref=e616] [cursor=pointer]:
                - generic [ref=e617]: 󰅖
              - heading "Adjust booking" [level=2] [ref=e620]
            - button "Save" [active] [ref=e622] [cursor=pointer]
          - separator [ref=e624]
        - generic [ref=e626]:
          - generic [ref=e628]:
            - table [ref=e632]:
              - rowgroup [ref=e633]:
                - row [ref=e634]:
                  - cell "Current booking items" [ref=e635]
                  - cell [ref=e636]
              - rowgroup [ref=e637]:
                - row [ref=e638]:
                  - cell "Handcrafted Box GdlSyz / Unit hsChC2 1 week" [ref=e639]: Handcrafted Box GdlSyz / Unit hsChC21 week
                  - cell "€50.00" [ref=e640]
              - rowgroup [ref=e641]:
                - row [ref=e642]:
                  - columnheader "Total excl. VAT" [ref=e643]
                  - columnheader "€50.00" [ref=e644]
                - row [ref=e645]:
                  - cell "VAT" [ref=e646]
                  - cell "€8.50" [ref=e647]
                - row [ref=e648]:
                  - cell "Total incl. VAT" [ref=e649]
                  - cell "€58.50" [ref=e650]
            - generic [ref=e651]:
              - group [ref=e652]:
                - heading "Adjust booking items" [level=4] [ref=e654]
                - generic [ref=e657]:
                  - generic [ref=e659]:
                    - combobox [ref=e661]:
                      - generic [ref=e663]:
                        - generic [ref=e664]: Handcrafted Box GdlSyz
                        - combobox "Unit type *" [ref=e666]
                      - button [ref=e668] [cursor=pointer]: 󰍝
                      - generic: Unit type *
                    - alert [ref=e669]
                  - generic [ref=e672]:
                    - combobox [ref=e674]:
                      - generic [ref=e676]:
                        - generic [ref=e677]: Unit hsChC2
                        - combobox "Unit *" [ref=e679]
                      - button [ref=e681] [cursor=pointer]: 󰍝
                      - generic: Unit *
                    - alert [ref=e682]
                  - generic [ref=e685]:
                    - combobox [ref=e687]:
                      - generic [ref=e689]:
                        - generic [ref=e691]:
                          - generic [ref=e692]: Advanced
                          - generic [ref=e693]: €180.00
                        - combobox "Booking plan *" [ref=e694]
                      - button [ref=e696] [cursor=pointer]: 󰍝
                      - generic: Booking plan *
                    - alert [ref=e697]
                  - generic [ref=e700]:
                    - combobox [ref=e702]:
                      - generic [ref=e703]:
                        - generic: Protection plan
                        - combobox "Protection plan" [ref=e705]
                      - text: 󰅙
                      - button [ref=e707] [cursor=pointer]: 󰍝
                    - alert [ref=e708]
                  - generic [ref=e711]:
                    - combobox [ref=e713]:
                      - generic [ref=e714]:
                        - generic: Deposit
                        - combobox "Deposit" [ref=e716]
                      - text: 󰅙
                      - button [ref=e718] [cursor=pointer]: 󰍝
                    - alert [ref=e719]
                  - generic [ref=e722]:
                    - combobox [ref=e724]:
                      - generic [ref=e725]:
                        - generic: Discount
                        - combobox "Discount" [ref=e727]
                      - text: 󰅙
                      - button [ref=e729] [cursor=pointer]: 󰍝
                    - alert [ref=e730]
              - group [ref=e732]:
                - heading "Adjust recurring products" [level=4] [ref=e734]
                - button "Add recurring product" [ref=e740] [cursor=pointer]
              - group [ref=e741]:
                - heading [level=4] [ref=e743]:
                  - generic [ref=e745]:
                    - text: Apply changes
                    - generic [ref=e746]: 󰋽
                - generic [ref=e749]:
                  - generic [ref=e751]:
                    - generic [ref=e753]:
                      - radio "Immediately 27 Aug 2026" [ref=e754]
                      - generic [ref=e755] [cursor=pointer]:
                        - text: Immediately
                        - generic [ref=e757]: 27 Aug 2026
                    - generic [ref=e759]:
                      - radio "End of current period 3 Sep 2026" [checked] [ref=e760]
                      - generic [ref=e761] [cursor=pointer]:
                        - text: End of current period
                        - generic [ref=e763]: 3 Sep 2026
                    - generic [ref=e765]:
                      - radio "On a custom date" [ref=e766]
                      - generic [ref=e767] [cursor=pointer]: On a custom date
                  - alert [ref=e769]:
                    - generic [ref=e770]: Apply changes is invalid
          - generic [ref=e775]:
            - table [ref=e779]:
              - rowgroup [ref=e780]:
                - row [ref=e781]:
                  - cell "Adjusted booking" [ref=e782]
                  - cell [ref=e783]
              - rowgroup [ref=e784]:
                - row [ref=e785]:
                  - cell "Handcrafted Box GdlSyz / Unit hsChC2 4 weeks" [ref=e786]: Handcrafted Box GdlSyz / Unit hsChC24 weeks
                  - cell "€180.00" [ref=e787]
              - rowgroup [ref=e788]:
                - row [ref=e789]:
                  - columnheader "Total excl. VAT" [ref=e790]
                  - columnheader "€180.00" [ref=e791]
                - row [ref=e792]:
                  - cell "VAT" [ref=e793]
                  - cell "€30.60" [ref=e794]
                - row [ref=e795]:
                  - cell "Total incl. VAT" [ref=e796]
                  - cell "€210.60" [ref=e797]
            - group [ref=e798]:
              - heading "Summary" [level=4] [ref=e800]
              - generic [ref=e803]:
                - generic [ref=e807]:
                  - generic [ref=e808]:
                    - generic [ref=e809]: 󰸘
                    - generic [ref=e811]: today
                  - generic [ref=e812]: Customer is renting Handcrafted Box GdlSyz (Unit hsChC2), on the “Basic” booking plan charged every week.
                - generic [ref=e817]:
                  - generic [ref=e818]:
                    - generic [ref=e819]: 󰸘
                    - generic [ref=e821]: 3 Sep 2026
                  - generic [ref=e822]: The booking plan will be adjusted to “Advanced” on a 4 weeks plan for €180.00.
                - generic [ref=e827]:
                  - generic [ref=e828]:
                    - generic [ref=e829]: 󰸘
                    - generic [ref=e831]: 3 Sep 2026
                  - generic [ref=e832]: The customer will receive an invoice which reflects the changes of the booking.
    - tooltip
    - tooltip
    - tooltip
    - tooltip
    - tooltip
```

# Test source

```ts
  19  |   readonly oneTimeProductsTable = new BookingAdjustmentOneTimeProductsTable(this.main);
  20  |   readonly applyChangesRadioGroup = new BookingAdjustmentApplyChangesRadioGroup(this.main);
  21  |   readonly prorationRadioGroup = new BookingAdjustmentProrationRadioGroup(this.main);
  22  |   readonly currentItemsTable = new BookingAdjustmentCurrentItemsTable(this.main);
  23  |   readonly adjustedItemsTable = new BookingAdjustmentAdjustedItemsTable(this.main);
  24  |   readonly summaryTimeline = new BookingAdjustmentSummaryTimeline(this.main);
  25  |   readonly revertDialog = new BookingAdjustmentRevertDialog(this.host);
  26  |   readonly errors = getDialogErrorsHost(this.main);
  27  |   readonly adjustedSnackbar = getSnackbarHost(this.host, 'Booking successfully adjusted');
  28  |   readonly noChangesSnackbar = getSnackbarHost(this.host, 'No changes applied');
  29  |   readonly outdatedSnackbar = getSnackbarHost(
  30  |     this.host,
  31  |     'The current data was updated somewhere else and does not reflect the current state. Please reload this window and try again.'
  32  |   );
  33  | 
  34  |   constructor(host: Page) {
  35  |     super(host, 'booking-adjustment-dialog');
  36  |   }
  37  | 
  38  |   async goto(bookingId: number): Promise<void> {
  39  |     await this.host.goto(`/bookings/${bookingId}/adjust`);
  40  |   }
  41  | 
  42  |   async adjust(data: BookingAdjustmentData): Promise<void> {
  43  |     await this.fill(data);
  44  |     await this.adjustAfterFill(data);
  45  |   }
  46  | 
  47  |   async revert(data: BookingAdjustmentData): Promise<void> {
  48  |     await this.fill(data);
  49  |     await this.submit();
  50  |     await this.revertDialog.confirm();
  51  |     await this.host.waitForURL(getDetailsPageRegExpUrl('bookings'));
  52  |   }
  53  | 
  54  |   async submitWithoutChanges(): Promise<void> {
  55  |     await Promise.all([
  56  |       this.noChangesSnackbar.waitFor(),
  57  |       this.host.waitForURL(getDetailsPageRegExpUrl('bookings')),
  58  |       this.submit(),
  59  |     ]);
  60  |   }
  61  | 
  62  |   async fill(data: BookingAdjustmentData): Promise<void> {
  63  |     if (data.unitType) {
  64  |       await this.itemsFieldSet.unitTypeAutocomplete.select(data.unitType.name);
  65  |     }
  66  | 
  67  |     if (data.unit) {
  68  |       await this.itemsFieldSet.unitAutocomplete.select(data.unit.name);
  69  |     }
  70  | 
  71  |     if (data.plan?.name) {
  72  |       await this.itemsFieldSet.bookingPlanAutocomplete.select(data.plan.name);
  73  |     }
  74  | 
  75  |     if (data.insurance) {
  76  |       await this.itemsFieldSet.protectionPlanAutocomplete.select(data.insurance.name);
  77  |     }
  78  | 
  79  |     if (data.deposit) {
  80  |       await this.itemsFieldSet.depositAutocomplete.select(data.deposit.name);
  81  |     }
  82  | 
  83  |     if (data.discount) {
  84  |       await this.itemsFieldSet.discountAutocomplete.select(data.discount.name);
  85  |     }
  86  | 
  87  |     for (const name of data.recurringProducts?.remove ?? []) {
  88  |       await this.recurringProductsTable.remove(name);
  89  |     }
  90  | 
  91  |     for (const change of data.recurringProducts?.changeQuantity ?? []) {
  92  |       await this.recurringProductsTable.setQuantity(change.name, change.quantity);
  93  |     }
  94  | 
  95  |     for (const item of data.recurringProducts?.add ?? []) {
  96  |       await this.recurringProductsTable.add(item.product.name, item.quantity);
  97  |     }
  98  | 
  99  |     for (const name of data.oneTimeProducts?.remove ?? []) {
  100 |       await this.oneTimeProductsTable.remove(name);
  101 |     }
  102 | 
  103 |     for (const change of data.oneTimeProducts?.changeQuantity ?? []) {
  104 |       await this.oneTimeProductsTable.setQuantity(change.name, change.quantity);
  105 |     }
  106 | 
  107 |     for (const item of data.oneTimeProducts?.add ?? []) {
  108 |       await this.oneTimeProductsTable.add(item.product.name, item.quantity);
  109 |     }
  110 | 
  111 |     await this.applyChangesRadioGroup.fill(data.applyType, data.applyDate);
  112 | 
  113 |     if (data.prorationBehavior) {
  114 |       await this.prorationRadioGroup.fill(data.prorationBehavior);
  115 |     }
  116 |   }
  117 | 
  118 |   async adjustAfterFill(data: BookingAdjustmentData): Promise<void> {
> 119 |     await Promise.all([this.adjustedSnackbar.or(this.outdatedSnackbar).waitFor(), this.submit()]);
      |                                                                        ^ Error: locator.waitFor: Test timeout of 240000ms exceeded.
  120 | 
  121 |     // Async post-create backend jobs can bump the booking's updated_at between the view load and the
  122 |     // save, failing the save's optimistic lock. Recover once, the way the error message tells the
  123 |     // user to: reload (which fetches a fresh timestamp), refill, and save again.
  124 |     if (await this.outdatedSnackbar.isVisible()) {
  125 |       // Accept the browser's unsaved-changes prompt that reloading the dirty form raises.
  126 |       this.host.once('dialog', (dialog) => void dialog.accept());
  127 |       await this.host.reload();
  128 |       await this.fill(data);
  129 |       await Promise.all([this.adjustedSnackbar.waitFor(), this.submit()]);
  130 |     }
  131 | 
  132 |     await this.host.waitForURL(getDetailsPageRegExpUrl('bookings'));
  133 |   }
  134 | 
  135 |   async submit(): Promise<void> {
  136 |     await this.adjustedItemsTable.loadingBar.waitFor({ state: 'hidden' });
  137 |     await this.submitButton.click();
  138 |   }
  139 | }
  140 | 
```