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.
115 lines
4.5 KiB
JavaScript
Executable File
115 lines
4.5 KiB
JavaScript
Executable File
"use strict";
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.NodeModulesEngineHost = exports.NodePackageDoesNotSupportSchematics = void 0;
|
|
const core_1 = require("@angular-devkit/core");
|
|
const node_path_1 = require("node:path");
|
|
const export_ref_1 = require("./export-ref");
|
|
const file_system_engine_host_base_1 = require("./file-system-engine-host-base");
|
|
const file_system_utility_1 = require("./file-system-utility");
|
|
class NodePackageDoesNotSupportSchematics extends core_1.BaseException {
|
|
constructor(name) {
|
|
super(`Package ${JSON.stringify(name)} was found but does not support schematics.`);
|
|
}
|
|
}
|
|
exports.NodePackageDoesNotSupportSchematics = NodePackageDoesNotSupportSchematics;
|
|
/**
|
|
* A simple EngineHost that uses NodeModules to resolve collections.
|
|
*/
|
|
class NodeModulesEngineHost extends file_system_engine_host_base_1.FileSystemEngineHostBase {
|
|
paths;
|
|
constructor(paths) {
|
|
super();
|
|
this.paths = paths;
|
|
}
|
|
resolve(name, requester, references = new Set()) {
|
|
// Keep track of the package requesting the schematic, in order to avoid infinite recursion
|
|
if (requester) {
|
|
if (references.has(requester)) {
|
|
references.add(requester);
|
|
throw new Error('Circular schematic reference detected: ' + JSON.stringify(Array.from(references)));
|
|
}
|
|
else {
|
|
references.add(requester);
|
|
}
|
|
}
|
|
let collectionPath = undefined;
|
|
const resolveOptions = {
|
|
paths: requester ? [(0, node_path_1.dirname)(requester), ...(this.paths || [])] : this.paths,
|
|
};
|
|
// Try to resolve as a package
|
|
try {
|
|
const packageJsonPath = require.resolve(`${name}/package.json`, resolveOptions);
|
|
const { schematics } = require(packageJsonPath);
|
|
if (!schematics || typeof schematics !== 'string') {
|
|
throw new NodePackageDoesNotSupportSchematics(name);
|
|
}
|
|
// If this is a relative path to the collection, then create the collection
|
|
// path in relation to the package path
|
|
if (schematics.startsWith('.')) {
|
|
const packageDirectory = (0, node_path_1.dirname)(packageJsonPath);
|
|
collectionPath = (0, node_path_1.resolve)(packageDirectory, schematics);
|
|
}
|
|
// Otherwise treat this as a package, and recurse to find the collection path
|
|
else {
|
|
collectionPath = this.resolve(schematics, packageJsonPath, references);
|
|
}
|
|
}
|
|
catch (e) {
|
|
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
throw e;
|
|
}
|
|
}
|
|
// If not a package, try to resolve as a file
|
|
if (!collectionPath) {
|
|
try {
|
|
collectionPath = require.resolve(name, resolveOptions);
|
|
}
|
|
catch (e) {
|
|
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
throw e;
|
|
}
|
|
}
|
|
}
|
|
// If not a package or a file, error
|
|
if (!collectionPath) {
|
|
throw new file_system_engine_host_base_1.CollectionCannotBeResolvedException(name);
|
|
}
|
|
return collectionPath;
|
|
}
|
|
_resolveCollectionPath(name, requester) {
|
|
const collectionPath = this.resolve(name, requester);
|
|
(0, file_system_utility_1.readJsonFile)(collectionPath);
|
|
return collectionPath;
|
|
}
|
|
_resolveReferenceString(refString, parentPath, collectionDescription) {
|
|
const ref = new export_ref_1.ExportStringRef(refString, parentPath);
|
|
if (!ref.ref) {
|
|
return null;
|
|
}
|
|
return { ref: ref.ref, path: ref.module };
|
|
}
|
|
_transformCollectionDescription(name, desc) {
|
|
if (!desc.schematics || typeof desc.schematics != 'object') {
|
|
throw new file_system_engine_host_base_1.CollectionMissingSchematicsMapException(name);
|
|
}
|
|
return {
|
|
...desc,
|
|
name,
|
|
};
|
|
}
|
|
_transformSchematicDescription(name, _collection, desc) {
|
|
if (!desc.factoryFn || !desc.path || !desc.description) {
|
|
throw new file_system_engine_host_base_1.SchematicMissingFieldsException(name);
|
|
}
|
|
return desc;
|
|
}
|
|
}
|
|
exports.NodeModulesEngineHost = NodeModulesEngineHost;
|
|
//# sourceMappingURL=node-module-engine-host.js.map
|