# 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:34: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 5975-7669-3476-898
            - generic [ref=e181]: Active
          - button [ref=e186] [cursor=pointer]:
            - generic [ref=e187]:
              - text: Actions
              - generic [ref=e188]: 󱨉
            - generic: 󱕂
        - generic [ref=e189]:
          - generic [ref=e190]:
            - tablist [ref=e191]:
              - generic [ref=e193]:
                - tab "Details" [selected] [ref=e194] [cursor=pointer]
                - tab "Timeline" [ref=e196] [cursor=pointer]
            - separator [ref=e198]
          - generic [ref=e199]:
            - generic [ref=e200]:
              - generic [ref=e202]:
                - heading "General" [level=3] [ref=e206]
                - table [ref=e209]:
                  - rowgroup [ref=e210]:
                    - row [ref=e211]:
                      - rowheader "Customer" [ref=e212]
                      - cell [ref=e213]:
                        - link "Isadore Hansen" [ref=e216] [cursor=pointer]:
                          - /url: /customers/1924152682
                    - row [ref=e219]:
                      - rowheader "Location" [ref=e220]
                      - cell [ref=e221]:
                        - link "Vienna South" [ref=e224] [cursor=pointer]:
                          - /url: /locations/5000500050
                    - row [ref=e227]:
                      - rowheader "Created at" [ref=e228]
                      - cell "29 Aug 2026" [ref=e229]
                    - row [ref=e232]:
                      - rowheader "Move-in" [ref=e233]
                      - cell "29 Aug 2026" [ref=e234]
                    - row [ref=e237]:
                      - rowheader "Move-out" [ref=e238]
                      - cell "-" [ref=e239]
                    - row [ref=e242]:
                      - rowheader "Cancelled at" [ref=e243]
                      - cell "-" [ref=e244]
                    - row [ref=e247]:
                      - rowheader "Deposit excl. VAT" [ref=e248]
                      - cell "-" [ref=e249]
                    - row [ref=e252]:
                      - rowheader "Discount" [ref=e253]
                      - cell "-" [ref=e254]
                    - row [ref=e257]:
                      - rowheader "Contract" [ref=e258]
                      - cell "-" [ref=e259]
              - generic [ref=e262]:
                - generic [ref=e263]:
                  - heading "Billing" [level=3] [ref=e267]
                  - table [ref=e270]:
                    - rowgroup [ref=e271]:
                      - row [ref=e272]:
                        - rowheader "Booking Plan" [ref=e273]
                        - cell "Basic (1 week)" [ref=e274]
                      - row [ref=e277]:
                        - rowheader "Current period" [ref=e278]
                        - cell "29 Aug - 5 Sep 2026" [ref=e279]
                      - row [ref=e282]:
                        - rowheader "Amount excl. VAT" [ref=e283]
                        - cell "€50.00" [ref=e284]
                      - row [ref=e287]:
                        - rowheader "Price adjustment" [ref=e288]
                        - cell "-" [ref=e289]
                      - row [ref=e292]:
                        - rowheader "Next invoice" [ref=e293]
                        - cell "5 Sep 2026 Show preview" [ref=e294]:
                          - generic [ref=e295]:
                            - generic [ref=e296]: 5 Sep 2026
                            - link "Show preview" [ref=e298] [cursor=pointer]:
                              - /url: /bookings/597576693476898/upcoming-invoice
                              - generic [ref=e299]: 󰛐
                      - row [ref=e302]:
                        - rowheader "Payment method" [ref=e303]
                        - cell "-" [ref=e304]
                      - row [ref=e307]:
                        - rowheader "Payment option" [ref=e308]
                        - cell "Automatic payment through Stripe" [ref=e309]
                - generic [ref=e312]:
                  - generic [ref=e314]:
                    - heading "Notes" [level=3] [ref=e316]
                    - link [ref=e318] [cursor=pointer]:
                      - /url: /bookings/597576693476898/edit/notes
                      - generic [ref=e319]: 󰲶
                  - table [ref=e323]:
                    - rowgroup [ref=e324]:
                      - row [ref=e325]:
                        - rowheader "Note" [ref=e326]
                        - cell "-" [ref=e327]
            - generic [ref=e330]:
              - heading "Items" [level=3] [ref=e334]
              - generic [ref=e337]:
                - generic [ref=e338]:
                  - generic [ref=e339]:
                    - link "Soft Box 8Wg2Tk" [ref=e340] [cursor=pointer]:
                      - /url: /unit-types/1677883104
                    - text: /
                    - link "Unit l8hRGn" [ref=e343] [cursor=pointer]:
                      - /url: /units/2026383914
                  - generic [ref=e346]: €50.00
                - generic [ref=e347]:
                  - generic [ref=e348]:
                    - strong [ref=e349]: Total excl. VAT
                    - strong [ref=e350]: €50.00
                  - generic [ref=e351]:
                    - generic [ref=e352]: VAT
                    - generic [ref=e353]: €8.50
                  - generic [ref=e354]:
                    - strong [ref=e355]: Total incl. VAT
                    - strong [ref=e356]: €58.50
            - generic [ref=e357]:
              - heading "Invoices" [level=3] [ref=e361]
              - generic [ref=e365]:
                - generic [ref=e367]:
                  - generic [ref=e369]:
                    - button "Select all" [ref=e377] [cursor=pointer]:
                      - generic [ref=e378]: 󰄬
                    - generic [ref=e381]:
                      - button "Mark as paid" [disabled] [ref=e384]:
                        - generic [ref=e385]: 󰗡
                      - button "SEPA XML actions" [disabled] [ref=e390]:
                        - generic [ref=e391]: 󱨉
                        - generic: 󰗡 󰅚 󰗖
                      - generic [ref=e396]:
                        - button [ref=e397] [cursor=pointer]
                        - generic: 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲 󰄲
                  - table [ref=e403]:
                    - rowgroup [ref=e404]:
                      - row [ref=e405]:
                        - columnheader [ref=e406]:
                          - generic [ref=e407]:
                            - checkbox [ref=e408]
                            - generic [ref=e409] [cursor=pointer]: 󰄱
                        - columnheader [ref=e411]:
                          - button "Number" [ref=e412] [cursor=pointer]:
                            - generic [ref=e415]: 󰁝
                        - columnheader [ref=e418]:
                          - button "Status" [ref=e419] [cursor=pointer]:
                            - generic [ref=e422]: 󰁝
                        - columnheader [ref=e425]:
                          - button "Payment option" [ref=e426] [cursor=pointer]:
                            - generic [ref=e429]: 󰁝
                        - columnheader [ref=e432]:
                          - button "Due date" [ref=e433] [cursor=pointer]:
                            - generic [ref=e436]: 󰁝
                        - columnheader [ref=e439]:
                          - button "Unit" [ref=e440] [cursor=pointer]:
                            - generic [ref=e443]: 󰁝
                        - columnheader "Discount" [ref=e446]
                        - columnheader [ref=e450]:
                          - button "Total (incl. VAT)" [ref=e451] [cursor=pointer]:
                            - generic [ref=e452]:
                              - generic [ref=e453]: Total (incl. VAT)
                              - generic [ref=e454]: 󰋽
                            - generic [ref=e456]: 󰁝
                        - columnheader [ref=e459]:
                          - button "Amount due" [ref=e460] [cursor=pointer]:
                            - generic [ref=e463]: 󰁝
                        - columnheader [ref=e466]:
                          - button "Issue date" [ref=e467] [cursor=pointer]:
                            - generic [ref=e470]: 󰁝
                        - columnheader "Actions" [ref=e473]
                      - row [ref=e477]:
                        - columnheader [ref=e478]
                    - rowgroup [ref=e479]:
                      - row [ref=e480]:
                        - cell [ref=e481]:
                          - generic [ref=e482]:
                            - checkbox [ref=e483]
                            - generic [ref=e484] [cursor=pointer]: 󰄱
                        - cell [ref=e486]:
                          - link "INV-2125025" [ref=e487] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e489]:
                          - link "Open" [ref=e490] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e495]:
                          - link "Manual" [ref=e496] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e498]:
                          - link "31 Aug 2026" [ref=e499] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e501]:
                          - link "Unit l8hRGn" [ref=e502] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell "-" [ref=e504]
                        - cell [ref=e506]:
                          - link "€58.50" [ref=e507] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e509]:
                          - link "€58.50" [ref=e510] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e512]:
                          - link "29 Aug 2026" [ref=e513] [cursor=pointer]:
                            - /url: /invoices/880881252
                        - cell [ref=e515]:
                          - button [ref=e518] [cursor=pointer]:
                            - generic [ref=e519]: 󰇘
                            - generic: 󰇚 󰯝
                - generic [ref=e523]:
                  - generic [ref=e524]:
                    - generic [ref=e525]: "Items per page:"
                    - combobox [ref=e528]:
                      - generic [ref=e530] [cursor=pointer]:
                        - generic [ref=e531]: "10"
                        - combobox "Items per page:": "10"
                      - generic [ref=e533]: 󰍝
                  - generic [ref=e535]: 1-1 of 1
                  - generic [ref=e536]:
                    - button [disabled]:
                      - generic: 󰘀
                    - button [disabled]:
                      - generic: 󰅁
                    - button [disabled]:
                      - generic: 󰅂
                    - button [disabled]:
                      - generic: 󰘁
            - generic [ref=e537]:
              - heading "Payments" [level=3] [ref=e541]
              - generic [ref=e545]:
                - table [ref=e549]:
                  - rowgroup [ref=e550]:
                    - row [ref=e551]:
                      - columnheader [ref=e552]:
                        - button "Total" [ref=e553] [cursor=pointer]:
                          - generic [ref=e556]: 󰁝
                      - columnheader [ref=e559]:
                        - button "Status" [ref=e560] [cursor=pointer]:
                          - generic [ref=e563]: 󰁝
                      - columnheader [ref=e566]:
                        - button "Invoice no." [ref=e567] [cursor=pointer]:
                          - generic [ref=e570]: 󰁝
                      - columnheader [ref=e573]:
                        - button "Date" [ref=e574] [cursor=pointer]:
                          - generic [ref=e577]: 󰁝
                      - columnheader [ref=e580]:
                        - button "Payment method" [ref=e581] [cursor=pointer]:
                          - generic [ref=e584]: 󰁝
                    - row [ref=e587]:
                      - columnheader [ref=e588]
                  - rowgroup [ref=e589]:
                    - row [ref=e590]:
                      - cell "€58.50" [ref=e591]
                      - cell "Not paid yet" [ref=e593]
                      - cell "INV-2125025" [ref=e598]
                      - cell "29 Aug 2026" [ref=e600]
                      - cell [ref=e602]
                - generic [ref=e605]:
                  - generic [ref=e606]:
                    - generic [ref=e607]: "Items per page:"
                    - combobox [ref=e610]:
                      - generic [ref=e612] [cursor=pointer]:
                        - generic [ref=e613]: "10"
                        - combobox "Items per page:": "10"
                      - generic [ref=e615]: 󰍝
                  - generic [ref=e617]: 1-1 of 1
                  - generic [ref=e618]:
                    - 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=e621]:
        - generic [ref=e622]:
          - generic [ref=e624]:
            - generic [ref=e625]:
              - button [ref=e626] [cursor=pointer]:
                - generic [ref=e627]: 󰅖
              - heading "Adjust booking" [level=2] [ref=e630]
            - button "Save" [active] [ref=e632] [cursor=pointer]
          - separator [ref=e634]
        - generic [ref=e636]:
          - generic [ref=e638]:
            - table [ref=e642]:
              - rowgroup [ref=e643]:
                - row [ref=e644]:
                  - cell "Current booking items" [ref=e645]
                  - cell [ref=e646]
              - rowgroup [ref=e647]:
                - row [ref=e648]:
                  - cell "Soft Box 8Wg2Tk / Unit l8hRGn 1 week" [ref=e649]: Soft Box 8Wg2Tk / Unit l8hRGn1 week
                  - cell "€50.00" [ref=e650]
              - rowgroup [ref=e651]:
                - row [ref=e652]:
                  - columnheader "Total excl. VAT" [ref=e653]
                  - columnheader "€50.00" [ref=e654]
                - row [ref=e655]:
                  - cell "VAT" [ref=e656]
                  - cell "€8.50" [ref=e657]
                - row [ref=e658]:
                  - cell "Total incl. VAT" [ref=e659]
                  - cell "€58.50" [ref=e660]
            - generic [ref=e661]:
              - group [ref=e662]:
                - heading "Adjust booking items" [level=4] [ref=e664]
                - generic [ref=e667]:
                  - generic [ref=e669]:
                    - combobox [ref=e671]:
                      - generic [ref=e673]:
                        - generic [ref=e674]: Soft Box 8Wg2Tk
                        - combobox "Unit type *" [ref=e676]
                      - button [ref=e678] [cursor=pointer]: 󰍝
                      - generic: Unit type *
                    - alert [ref=e679]
                  - generic [ref=e682]:
                    - combobox [ref=e684]:
                      - generic [ref=e686]:
                        - generic [ref=e687]: Unit l8hRGn
                        - combobox "Unit *" [ref=e689]
                      - button [ref=e691] [cursor=pointer]: 󰍝
                      - generic: Unit *
                    - alert [ref=e692]
                  - generic [ref=e695]:
                    - combobox [ref=e697]:
                      - generic [ref=e699]:
                        - generic [ref=e701]:
                          - generic [ref=e702]: Advanced
                          - generic [ref=e703]: €180.00
                        - combobox "Booking plan *" [ref=e704]
                      - button [ref=e706] [cursor=pointer]: 󰍝
                      - generic: Booking plan *
                    - alert [ref=e707]
                  - generic [ref=e710]:
                    - combobox [ref=e712]:
                      - generic [ref=e713]:
                        - generic: Protection plan
                        - combobox "Protection plan" [ref=e715]
                      - text: 󰅙
                      - button [ref=e717] [cursor=pointer]: 󰍝
                    - alert [ref=e718]
                  - generic [ref=e721]:
                    - combobox [ref=e723]:
                      - generic [ref=e724]:
                        - generic: Deposit
                        - combobox "Deposit" [ref=e726]
                      - text: 󰅙
                      - button [ref=e728] [cursor=pointer]: 󰍝
                    - alert [ref=e729]
                  - generic [ref=e732]:
                    - combobox [ref=e734]:
                      - generic [ref=e735]:
                        - generic: Discount
                        - combobox "Discount" [ref=e737]
                      - text: 󰅙
                      - button [ref=e739] [cursor=pointer]: 󰍝
                    - alert [ref=e740]
              - group [ref=e742]:
                - heading "Adjust recurring products" [level=4] [ref=e744]
                - button "Add recurring product" [ref=e750] [cursor=pointer]
              - group [ref=e751]:
                - heading [level=4] [ref=e753]:
                  - generic [ref=e755]:
                    - text: Apply changes
                    - generic [ref=e756]: 󰋽
                - generic [ref=e759]:
                  - generic [ref=e761]:
                    - generic [ref=e763]:
                      - radio "Immediately 29 Aug 2026" [ref=e764]
                      - generic [ref=e765] [cursor=pointer]:
                        - text: Immediately
                        - generic [ref=e767]: 29 Aug 2026
                    - generic [ref=e769]:
                      - radio "End of current period 5 Sep 2026" [checked] [ref=e770]
                      - generic [ref=e771] [cursor=pointer]:
                        - text: End of current period
                        - generic [ref=e773]: 5 Sep 2026
                    - generic [ref=e775]:
                      - radio "On a custom date" [ref=e776]
                      - generic [ref=e777] [cursor=pointer]: On a custom date
                  - alert [ref=e779]:
                    - generic [ref=e780]: Apply changes is invalid
          - generic [ref=e785]:
            - table [ref=e789]:
              - rowgroup [ref=e790]:
                - row [ref=e791]:
                  - cell "Adjusted booking" [ref=e792]
                  - cell [ref=e793]
              - rowgroup [ref=e794]:
                - row [ref=e795]:
                  - cell "Soft Box 8Wg2Tk / Unit l8hRGn 4 weeks" [ref=e796]: Soft Box 8Wg2Tk / Unit l8hRGn4 weeks
                  - cell "€180.00" [ref=e797]
              - rowgroup [ref=e798]:
                - row [ref=e799]:
                  - columnheader "Total excl. VAT" [ref=e800]
                  - columnheader "€180.00" [ref=e801]
                - row [ref=e802]:
                  - cell "VAT" [ref=e803]
                  - cell "€30.60" [ref=e804]
                - row [ref=e805]:
                  - cell "Total incl. VAT" [ref=e806]
                  - cell "€210.60" [ref=e807]
            - group [ref=e808]:
              - heading "Summary" [level=4] [ref=e810]
              - generic [ref=e813]:
                - generic [ref=e817]:
                  - generic [ref=e818]:
                    - generic [ref=e819]: 󰸘
                    - generic [ref=e821]: today
                  - generic [ref=e822]: Customer is renting Soft Box 8Wg2Tk (Unit l8hRGn), on the “Basic” booking plan charged every week.
                - generic [ref=e827]:
                  - generic [ref=e828]:
                    - generic [ref=e829]: 󰸘
                    - generic [ref=e831]: 5 Sep 2026
                  - generic [ref=e832]: The booking plan will be adjusted to “Advanced” on a 4 weeks plan for €180.00.
                - generic [ref=e837]:
                  - generic [ref=e838]:
                    - generic [ref=e839]: 󰸘
                    - generic [ref=e841]: 5 Sep 2026
                  - generic [ref=e842]: 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 | 
```