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.
148 lines
6.4 KiB
JavaScript
148 lines
6.4 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.defaultLoadersSync = exports.defaultLoaders = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = exports.cosmiconfigSync = exports.cosmiconfig = void 0;
|
|
const defaults_1 = require("./defaults");
|
|
Object.defineProperty(exports, "defaultLoaders", { enumerable: true, get: function () { return defaults_1.defaultLoaders; } });
|
|
Object.defineProperty(exports, "defaultLoadersSync", { enumerable: true, get: function () { return defaults_1.defaultLoadersSync; } });
|
|
Object.defineProperty(exports, "getDefaultSearchPlaces", { enumerable: true, get: function () { return defaults_1.getDefaultSearchPlaces; } });
|
|
Object.defineProperty(exports, "getDefaultSearchPlacesSync", { enumerable: true, get: function () { return defaults_1.getDefaultSearchPlacesSync; } });
|
|
Object.defineProperty(exports, "globalConfigSearchPlaces", { enumerable: true, get: function () { return defaults_1.globalConfigSearchPlaces; } });
|
|
Object.defineProperty(exports, "globalConfigSearchPlacesSync", { enumerable: true, get: function () { return defaults_1.globalConfigSearchPlacesSync; } });
|
|
const Explorer_js_1 = require("./Explorer.js");
|
|
const ExplorerSync_js_1 = require("./ExplorerSync.js");
|
|
const util_1 = require("./util");
|
|
const identity = function identity(x) {
|
|
return x;
|
|
};
|
|
function getUserDefinedOptionsFromMetaConfig() {
|
|
const metaExplorer = new ExplorerSync_js_1.ExplorerSync({
|
|
moduleName: 'cosmiconfig',
|
|
stopDir: process.cwd(),
|
|
searchPlaces: defaults_1.metaSearchPlaces,
|
|
ignoreEmptySearchPlaces: false,
|
|
applyPackagePropertyPathToConfiguration: true,
|
|
loaders: defaults_1.defaultLoaders,
|
|
transform: identity,
|
|
cache: true,
|
|
metaConfigFilePath: null,
|
|
mergeImportArrays: true,
|
|
mergeSearchPlaces: true,
|
|
searchStrategy: 'none',
|
|
});
|
|
const metaConfig = metaExplorer.search();
|
|
if (!metaConfig) {
|
|
return null;
|
|
}
|
|
if (metaConfig.config?.loaders) {
|
|
throw new Error('Can not specify loaders in meta config file');
|
|
}
|
|
if (metaConfig.config?.searchStrategy) {
|
|
throw new Error('Can not specify searchStrategy in meta config file');
|
|
}
|
|
const overrideOptions = {
|
|
mergeSearchPlaces: true,
|
|
...(metaConfig.config ?? {}),
|
|
};
|
|
return {
|
|
config: (0, util_1.removeUndefinedValuesFromObject)(overrideOptions),
|
|
filepath: metaConfig.filepath,
|
|
};
|
|
}
|
|
function getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions) {
|
|
const userConfiguredSearchPlaces = userConfiguredOptions.searchPlaces?.map((path) => path.replace('{name}', moduleName));
|
|
if (userConfiguredOptions.mergeSearchPlaces) {
|
|
return [...(userConfiguredSearchPlaces ?? []), ...toolDefinedSearchPlaces];
|
|
}
|
|
return (userConfiguredSearchPlaces ??
|
|
/* istanbul ignore next */ toolDefinedSearchPlaces);
|
|
}
|
|
function mergeOptionsBase(moduleName, defaults, options) {
|
|
const userDefinedConfig = getUserDefinedOptionsFromMetaConfig();
|
|
if (!userDefinedConfig) {
|
|
return {
|
|
...defaults,
|
|
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
loaders: {
|
|
...defaults.loaders,
|
|
...options.loaders,
|
|
},
|
|
};
|
|
}
|
|
const userConfiguredOptions = userDefinedConfig.config;
|
|
const toolDefinedSearchPlaces = options.searchPlaces ?? defaults.searchPlaces;
|
|
return {
|
|
...defaults,
|
|
...(0, util_1.removeUndefinedValuesFromObject)(options),
|
|
metaConfigFilePath: userDefinedConfig.filepath,
|
|
...userConfiguredOptions,
|
|
searchPlaces: getResolvedSearchPlaces(moduleName, toolDefinedSearchPlaces, userConfiguredOptions),
|
|
loaders: {
|
|
...defaults.loaders,
|
|
...options.loaders,
|
|
},
|
|
};
|
|
}
|
|
function validateOptions(options) {
|
|
if (options.searchStrategy != null &&
|
|
options.searchStrategy !== 'global' &&
|
|
options.stopDir) {
|
|
throw new Error('Can not supply `stopDir` option with `searchStrategy` other than "global"');
|
|
}
|
|
}
|
|
function mergeOptions(moduleName, options) {
|
|
validateOptions(options);
|
|
const defaults = {
|
|
moduleName,
|
|
searchPlaces: (0, defaults_1.getDefaultSearchPlaces)(moduleName),
|
|
ignoreEmptySearchPlaces: true,
|
|
cache: true,
|
|
transform: identity,
|
|
loaders: defaults_1.defaultLoaders,
|
|
metaConfigFilePath: null,
|
|
mergeImportArrays: true,
|
|
mergeSearchPlaces: true,
|
|
searchStrategy: options.stopDir ? 'global' : 'none',
|
|
};
|
|
return mergeOptionsBase(moduleName, defaults, options);
|
|
}
|
|
function mergeOptionsSync(moduleName, options) {
|
|
validateOptions(options);
|
|
const defaults = {
|
|
moduleName,
|
|
searchPlaces: (0, defaults_1.getDefaultSearchPlacesSync)(moduleName),
|
|
ignoreEmptySearchPlaces: true,
|
|
cache: true,
|
|
transform: identity,
|
|
loaders: defaults_1.defaultLoadersSync,
|
|
metaConfigFilePath: null,
|
|
mergeImportArrays: true,
|
|
mergeSearchPlaces: true,
|
|
searchStrategy: options.stopDir ? 'global' : 'none',
|
|
};
|
|
return mergeOptionsBase(moduleName, defaults, options);
|
|
}
|
|
function cosmiconfig(moduleName, options = {}) {
|
|
const normalizedOptions = mergeOptions(moduleName, options);
|
|
const explorer = new Explorer_js_1.Explorer(normalizedOptions);
|
|
return {
|
|
search: explorer.search.bind(explorer),
|
|
load: explorer.load.bind(explorer),
|
|
clearLoadCache: explorer.clearLoadCache.bind(explorer),
|
|
clearSearchCache: explorer.clearSearchCache.bind(explorer),
|
|
clearCaches: explorer.clearCaches.bind(explorer),
|
|
};
|
|
}
|
|
exports.cosmiconfig = cosmiconfig;
|
|
function cosmiconfigSync(moduleName, options = {}) {
|
|
const normalizedOptions = mergeOptionsSync(moduleName, options);
|
|
const explorerSync = new ExplorerSync_js_1.ExplorerSync(normalizedOptions);
|
|
return {
|
|
search: explorerSync.search.bind(explorerSync),
|
|
load: explorerSync.load.bind(explorerSync),
|
|
clearLoadCache: explorerSync.clearLoadCache.bind(explorerSync),
|
|
clearSearchCache: explorerSync.clearSearchCache.bind(explorerSync),
|
|
clearCaches: explorerSync.clearCaches.bind(explorerSync),
|
|
};
|
|
}
|
|
exports.cosmiconfigSync = cosmiconfigSync;
|
|
//# sourceMappingURL=index.js.map
|