mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 21:46:49 +00:00
cb7014b378
Costs gets a second view next to the ledger: the expenses as a table grouped by category, with name, date, total, persons and days editable in place and the per person and per day figures worked out beside them. A total with a payer or in a foreign currency stays locked and opens the expense instead, so balances and frozen rates are never changed behind the dialog. In the table view the side column shows a summary by category, day, payer and status. The switch sits in the bar and the choice is remembered; the ledger stays the default. On the Plan tab a place's reservation shows as one Reservation pill whose colour carries the status and which opens the booking, and the drop line of a drag that lost its source row now clears on the next mouse move. The booking detail formats its times in the user's clock, and a hotel without a check-out runs to the end of the last day in the timeline. The wiki pages of the trip are rewritten for the new layout, with new screenshots from the screenshot run (new Plan tab, bookings, transports, dialogs, costs table). The help center guides of the Plan tab are rewritten and translated into every locale, and every new string is translated.
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import { test, clearNotices, expect, seed } from './shot'
|
|
|
|
/**
|
|
* Modals and dialogs.
|
|
*
|
|
* Captured as element screenshots (not full page) so the wiki gets the dialog
|
|
* itself rather than a dimmed backdrop with a small box in the middle. Each one
|
|
* asserts the dialog is actually open first — a missed click would otherwise
|
|
* silently produce a screenshot of the page behind it.
|
|
*/
|
|
|
|
|
|
/**
|
|
* The shared Modal (client/src/components/shared/Modal.tsx) sets neither
|
|
* role="dialog" nor aria-modal, so there is no accessible role to query — the
|
|
* backdrop class is the only stable hook. Target its child, which is the panel
|
|
* itself, so the capture excludes the dimmed backdrop.
|
|
*/
|
|
function dialog(page: import('@playwright/test').Page) {
|
|
return page.locator('.trek-modal-backdrop > div').first()
|
|
}
|
|
|
|
test('create trip modal — with the new currency field', async ({ page, shot }) => {
|
|
await page.goto('/dashboard')
|
|
await clearNotices(page)
|
|
await page.getByRole('button', { name: /new trip/i }).first().click()
|
|
await expect(dialog(page)).toBeVisible()
|
|
await shot.element('TripCreate', dialog(page))
|
|
})
|
|
|
|
test('share dialog', async ({ page, shot }) => {
|
|
await page.goto(`/trips/${seed.tripId}`)
|
|
await clearNotices(page)
|
|
await page.getByRole('button', { name: /share/i }).first().click()
|
|
await expect(dialog(page)).toBeVisible()
|
|
await shot.element('Share', dialog(page))
|
|
})
|