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.
87 lines
3.4 KiB
JavaScript
87 lines
3.4 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.sandbox = exports.createPacResolver = void 0;
|
|
const degenerator_1 = require("degenerator");
|
|
/**
|
|
* Built-in PAC functions.
|
|
*/
|
|
const dateRange_1 = __importDefault(require("./dateRange"));
|
|
const dnsDomainIs_1 = __importDefault(require("./dnsDomainIs"));
|
|
const dnsDomainLevels_1 = __importDefault(require("./dnsDomainLevels"));
|
|
const dnsResolve_1 = __importDefault(require("./dnsResolve"));
|
|
const isInNet_1 = __importDefault(require("./isInNet"));
|
|
const isPlainHostName_1 = __importDefault(require("./isPlainHostName"));
|
|
const isResolvable_1 = __importDefault(require("./isResolvable"));
|
|
const localHostOrDomainIs_1 = __importDefault(require("./localHostOrDomainIs"));
|
|
const myIpAddress_1 = __importDefault(require("./myIpAddress"));
|
|
const shExpMatch_1 = __importDefault(require("./shExpMatch"));
|
|
const timeRange_1 = __importDefault(require("./timeRange"));
|
|
const weekdayRange_1 = __importDefault(require("./weekdayRange"));
|
|
/**
|
|
* Returns an asynchronous `FindProxyForURL()` function
|
|
* from the given JS string (from a PAC file).
|
|
*/
|
|
function createPacResolver(qjs, _str, _opts = {}) {
|
|
const str = Buffer.isBuffer(_str) ? _str.toString('utf8') : _str;
|
|
// The sandbox to use for the `vm` context.
|
|
const context = {
|
|
...exports.sandbox,
|
|
..._opts.sandbox,
|
|
};
|
|
// Construct the array of async function names to add `await` calls to.
|
|
const names = Object.keys(context).filter((k) => isAsyncFunction(context[k]));
|
|
const opts = {
|
|
filename: 'proxy.pac',
|
|
names,
|
|
..._opts,
|
|
sandbox: context,
|
|
};
|
|
// Compile the JS `FindProxyForURL()` function into an async function.
|
|
const resolver = (0, degenerator_1.compile)(qjs, str, 'FindProxyForURL', opts);
|
|
function FindProxyForURL(url, _host) {
|
|
const urlObj = typeof url === 'string' ? new URL(url) : url;
|
|
const host = _host || urlObj.hostname;
|
|
if (!host) {
|
|
throw new TypeError('Could not determine `host`');
|
|
}
|
|
return resolver(urlObj.href, host);
|
|
}
|
|
Object.defineProperty(FindProxyForURL, 'toString', {
|
|
value: () => resolver.toString(),
|
|
enumerable: false,
|
|
});
|
|
return FindProxyForURL;
|
|
}
|
|
exports.createPacResolver = createPacResolver;
|
|
exports.sandbox = Object.freeze({
|
|
alert: (message = '') => console.log('%s', message),
|
|
dateRange: dateRange_1.default,
|
|
dnsDomainIs: dnsDomainIs_1.default,
|
|
dnsDomainLevels: dnsDomainLevels_1.default,
|
|
dnsResolve: dnsResolve_1.default,
|
|
isInNet: isInNet_1.default,
|
|
isPlainHostName: isPlainHostName_1.default,
|
|
isResolvable: isResolvable_1.default,
|
|
localHostOrDomainIs: localHostOrDomainIs_1.default,
|
|
myIpAddress: myIpAddress_1.default,
|
|
shExpMatch: shExpMatch_1.default,
|
|
timeRange: timeRange_1.default,
|
|
weekdayRange: weekdayRange_1.default,
|
|
});
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
function isAsyncFunction(v) {
|
|
if (typeof v !== 'function')
|
|
return false;
|
|
// Native `AsyncFunction`
|
|
if (v.constructor.name === 'AsyncFunction')
|
|
return true;
|
|
// TypeScript compiled
|
|
if (String(v).indexOf('__awaiter(') !== -1)
|
|
return true;
|
|
// Legacy behavior - set `async` property on the function
|
|
return Boolean(v.async);
|
|
}
|
|
//# sourceMappingURL=index.js.map
|