OnlineBoard search: render Купить/Онлайн регистрация in expanded row
Angular's board search results expansion shows [Купить] [Онлайн регистрация] [Детали рейса]. React only rendered Details. Added a `renderActions` prop on FlightCard/FlightList so the feature layer can inject extra buttons without the ui layer importing from features. OnlineBoardSearchPage wires it to FlightActions with showShare=false (the row already has a dedicated share icon). Visibility rules fall through to canBuyTicket / canRegister (same as BoardDetailsHeader), so cancelled/past flights still hide the Buy button and carriers without a registrationUrl still hide the Online Registration button — matching Angular's per-flight gating. Integration test mocks useAppSettings to avoid requiring the real ApiClientProvider in flight-search.test.tsx.
This commit is contained in:
@@ -64,6 +64,24 @@ vi.mock("@/shared/dictionaries/index.js", () => ({
|
||||
useDictionaries: () => ({ dictionaries: null, loading: false, error: null }),
|
||||
}));
|
||||
|
||||
// FlightActions (rendered inside each expanded flight row) pulls the
|
||||
// buy/registration window lengths from useAppSettings, which itself
|
||||
// needs the ApiClientProvider. Integration tests don't wire the real
|
||||
// API client, so mock useAppSettings with the Angular defaults.
|
||||
vi.mock("@/shared/hooks/useAppSettings.js", () => ({
|
||||
useAppSettings: () => ({
|
||||
onlineboardSearchFrom: 1,
|
||||
onlineboardSearchTo: 7,
|
||||
scheduleSearchFrom: 1,
|
||||
scheduleSearchTo: 330,
|
||||
flightStatusAvailableFromHours: 2,
|
||||
buyTicketMinHours: 2,
|
||||
buyTicketMaxHours: 72,
|
||||
loading: false,
|
||||
error: null,
|
||||
}),
|
||||
}));
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Helpers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user