Files
TREK/client/tests/helpers/placeFormSetup.ts
T
Maurice b71e32cf12 fix(tours): clear the last lint, knip and wiring findings of the follow-up
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.
2026-10-20 22:13:25 +02:00

27 lines
844 B
TypeScript

import { vi } from 'vitest';
import { useAuthStore } from '../../src/store/authStore';
import { useTripStore } from '../../src/store/tripStore';
import { buildTrip, buildUser } from './factories';
import { seedStore } from './store';
/** The props an open place form gets when a test sets none: a new place in trip 1. */
export const placeFormProps = {
isOpen: true,
onClose: vi.fn(),
onSave: vi.fn(),
place: null,
prefillCoords: null,
tripId: 1,
categories: [],
onCategoryCreated: vi.fn(),
assignmentId: null,
dayAssignments: [],
};
/** A signed-in user without a maps key, in trip 1: what the form reads before it renders. */
export function seedPlaceFormStores() {
seedStore(useAuthStore, { user: buildUser(), isAuthenticated: true, hasMapsKey: false });
seedStore(useTripStore, { trip: buildTrip({ id: 1 }) });
}