Files
TREK/client/src/components/Planner/placeDialogParts.test.tsx
T
Maurice cb7014b378 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.
2026-09-27 23:15:19 +02:00

29 lines
1.4 KiB
TypeScript

// FE-PLANNER-PLACEDLGPARTS-001 to FE-PLANNER-PLACEDLGPARTS-004
import { describe, it, expect } from 'vitest';
import { render, screen } from '../../../tests/helpers/render';
import { COLUMN_CARD, ColumnHead, HintCard, SIDE_COLUMN, WHITE_BUTTON } from './placeDialogParts';
describe('placeDialogParts', () => {
it('FE-PLANNER-PLACEDLGPARTS-001: ColumnHead names its column as a heading, with its icon beside it', () => {
render(<ColumnHead icon={<span data-testid="col-icon" />}>Place details</ColumnHead>);
expect(screen.getByRole('heading', { level: 3, name: 'Place details' })).toBeInTheDocument();
expect(screen.getByTestId('col-icon')).toBeInTheDocument();
});
it('FE-PLANNER-PLACEDLGPARTS-002: HintCard says its line next to its icon', () => {
render(<HintCard icon={<span data-testid="hint-icon" />}>Pick a place to see its details</HintCard>);
expect(screen.getByText('Pick a place to see its details')).toBeInTheDocument();
expect(screen.getByTestId('hint-icon')).toBeInTheDocument();
});
it('FE-PLANNER-PLACEDLGPARTS-003: the column frame stretches with the dialog and clips its cards', () => {
expect(SIDE_COLUMN).toContain('self-stretch');
expect(SIDE_COLUMN).toContain('overflow-hidden');
expect(COLUMN_CARD).toContain('bg-surface-card');
});
it('FE-PLANNER-PLACEDLGPARTS-004: the white button dims when disabled', () => {
expect(WHITE_BUTTON).toContain('disabled:opacity-50');
});
});