mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
b71e32cf12
The unused day pills go, a client-only type stops being exported, the place form context moves out of the page hook so its view model stays the first object it returns, the place form test helpers split the stub component from the plain setup, and four router files are formatted.
30 lines
713 B
TypeScript
30 lines
713 B
TypeScript
/**
|
|
* Stands in for CustomTimePicker in the place form's tests: a plain text input
|
|
* instead of the portal-heavy picker. The aria props land on the input, as the
|
|
* real picker spreads them onto its own. Hand it to vi.mock as the default export.
|
|
*/
|
|
export function TimePickerStub({
|
|
value,
|
|
onChange,
|
|
placeholder,
|
|
...aria
|
|
}: {
|
|
value: string;
|
|
onChange: (v: string) => void;
|
|
placeholder?: string;
|
|
'aria-label'?: string;
|
|
'aria-describedby'?: string;
|
|
'aria-invalid'?: boolean;
|
|
}) {
|
|
return (
|
|
<input
|
|
{...aria}
|
|
data-testid="time-picker"
|
|
type="text"
|
|
value={value}
|
|
onChange={(e) => onChange(e.target.value)}
|
|
placeholder={placeholder ?? '00:00'}
|
|
/>
|
|
);
|
|
}
|