mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-22 15:06:32 +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.
27 lines
844 B
TypeScript
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 }) });
|
|
}
|