60e2149072
Tasks 16-20: Online Board Tests (Search/Filter, Tabs, Flight List, Details Modal, Time/Date) - Task 16: Search & Filter tests (37 tests) - departure/arrival cities, passenger count, cabin class - Task 17: Arrival/Departure Tabs tests (45 tests) - tab switching, flight display, sorting - Task 18: Flight List View tests (50 tests) - display, sorting, filtering, pagination, loading states - Task 19: Flight Details Modal tests (40 tests) - opening/closing, content display, actions - Task 20: Time & Date Filter tests (43 tests) - date selection, time ranges, calendar navigation Tasks 21-25: Flight Details Tests (Flight Info, Passengers, Seats, Services, Fares) - Task 21: Flight Info Display tests (40 tests) - basic info, airports, route visualization, timeline - Task 22: Passenger Info tests (50 tests) - passenger list, details, services, special requirements - Task 23: Seat Selection tests (50 tests) - seat map, selection, categories, recommendations - Task 24: Service Selection tests (25 tests) - baggage, meals, seats, summary - Task 25: Fare Display tests (55 tests) - fare breakdown, comparisons, discounts, refunds All tests follow AAA pattern and use data-testid selectors matching Angular version. Total: 245 tests across 10 feature suites.
56 lines
1.7 KiB
JavaScript
56 lines
1.7 KiB
JavaScript
// src/helper/dev/index.ts
|
|
import { getColorEnabled } from "../../utils/color.js";
|
|
import { findTargetHandler, isMiddleware } from "../../utils/handler.js";
|
|
var handlerName = (handler) => {
|
|
return handler.name || (isMiddleware(handler) ? "[middleware]" : "[handler]");
|
|
};
|
|
var inspectRoutes = (hono) => {
|
|
return hono.routes.map(({ path, method, handler }) => {
|
|
const targetHandler = findTargetHandler(handler);
|
|
return {
|
|
path,
|
|
method,
|
|
name: handlerName(targetHandler),
|
|
isMiddleware: isMiddleware(targetHandler)
|
|
};
|
|
});
|
|
};
|
|
var showRoutes = (hono, opts) => {
|
|
const colorEnabled = opts?.colorize ?? getColorEnabled();
|
|
const routeData = {};
|
|
let maxMethodLength = 0;
|
|
let maxPathLength = 0;
|
|
inspectRoutes(hono).filter(({ isMiddleware: isMiddleware2 }) => opts?.verbose || !isMiddleware2).map((route) => {
|
|
const key = `${route.method}-${route.path}`;
|
|
(routeData[key] ||= []).push(route);
|
|
if (routeData[key].length > 1) {
|
|
return;
|
|
}
|
|
maxMethodLength = Math.max(maxMethodLength, route.method.length);
|
|
maxPathLength = Math.max(maxPathLength, route.path.length);
|
|
return { method: route.method, path: route.path, routes: routeData[key] };
|
|
}).forEach((data) => {
|
|
if (!data) {
|
|
return;
|
|
}
|
|
const { method, path, routes } = data;
|
|
const methodStr = colorEnabled ? `\x1B[32m${method}\x1B[0m` : method;
|
|
console.log(`${methodStr} ${" ".repeat(maxMethodLength - method.length)} ${path}`);
|
|
if (!opts?.verbose) {
|
|
return;
|
|
}
|
|
routes.forEach(({ name }) => {
|
|
console.log(`${" ".repeat(maxMethodLength + 3)} ${name}`);
|
|
});
|
|
});
|
|
};
|
|
var getRouterName = (app) => {
|
|
app.router.match("GET", "/");
|
|
return app.router.name;
|
|
};
|
|
export {
|
|
getRouterName,
|
|
inspectRoutes,
|
|
showRoutes
|
|
};
|