mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 10:24:05 +00:00
feat(costs): table view, and the wiki and help center for the new trip page
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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// FE-BUDGET-SCAN-001 to FE-BUDGET-SCAN-010
|
||||
// FE-BUDGET-SCAN-001 to FE-BUDGET-SCAN-011
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { http, HttpResponse } from 'msw'
|
||||
import { render, screen, fireEvent, waitFor } from '../../../tests/helpers/render'
|
||||
@@ -148,4 +148,20 @@ describe('MReceiptScanButton', () => {
|
||||
await new Promise(r => setTimeout(r, 20))
|
||||
expect(container).toBeEmptyDOMElement()
|
||||
})
|
||||
|
||||
it('FE-BUDGET-SCAN-011: the drop zone lights up while a photo is dragged over it, and a click on it opens the picker', async () => {
|
||||
render(<Harness />)
|
||||
await openDialog()
|
||||
const zone = screen.getByText('Drop the receipt photo here, or click to pick or take one').closest('button')!
|
||||
fireEvent.dragEnter(zone)
|
||||
expect(screen.getByText('Drop the photo to scan it')).toBeInTheDocument()
|
||||
// Leaving for a child of the zone keeps it lit, leaving the zone itself does not.
|
||||
fireEvent.dragLeave(zone.firstElementChild!)
|
||||
expect(screen.getByText('Drop the photo to scan it')).toBeInTheDocument()
|
||||
fireEvent.dragLeave(zone)
|
||||
expect(screen.getByText('Drop the receipt photo here, or click to pick or take one')).toBeInTheDocument()
|
||||
const pick = vi.spyOn(input(), 'click')
|
||||
fireEvent.click(zone)
|
||||
expect(pick).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user