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.0 KiB
JavaScript
Executable File
87 lines
3.0 KiB
JavaScript
Executable File
'use strict';
|
|
/**
|
|
* @license Angular
|
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
* License: MIT
|
|
*/
|
|
|
|
// packages/zone.js/lib/common/fetch.js
|
|
function patchFetch(Zone2) {
|
|
Zone2.__load_patch("fetch", (global, Zone3, api) => {
|
|
let fetch = global["fetch"];
|
|
if (typeof fetch !== "function") {
|
|
return;
|
|
}
|
|
const originalFetch = global[api.symbol("fetch")];
|
|
if (originalFetch) {
|
|
fetch = originalFetch;
|
|
}
|
|
const ZoneAwarePromise = global.Promise;
|
|
const symbolThenPatched = api.symbol("thenPatched");
|
|
const fetchTaskScheduling = api.symbol("fetchTaskScheduling");
|
|
const OriginalResponse = global.Response;
|
|
const placeholder = function() {
|
|
};
|
|
const createFetchTask = (source, data, originalImpl, self, args, ac) => new Promise((resolve, reject) => {
|
|
const task = Zone3.current.scheduleMacroTask(source, placeholder, data, () => {
|
|
let implPromise;
|
|
let zone = Zone3.current;
|
|
try {
|
|
zone[fetchTaskScheduling] = true;
|
|
implPromise = originalImpl.apply(self, args);
|
|
} catch (error) {
|
|
reject(error);
|
|
return;
|
|
} finally {
|
|
zone[fetchTaskScheduling] = false;
|
|
}
|
|
if (!(implPromise instanceof ZoneAwarePromise)) {
|
|
let ctor = implPromise.constructor;
|
|
if (!ctor[symbolThenPatched]) {
|
|
api.patchThen(ctor);
|
|
}
|
|
}
|
|
implPromise.then((resource) => {
|
|
if (task.state !== "notScheduled") {
|
|
task.invoke();
|
|
}
|
|
resolve(resource);
|
|
}, (error) => {
|
|
if (task.state !== "notScheduled") {
|
|
task.invoke();
|
|
}
|
|
reject(error);
|
|
});
|
|
}, () => {
|
|
ac == null ? void 0 : ac.abort();
|
|
});
|
|
});
|
|
global["fetch"] = function() {
|
|
const args = Array.prototype.slice.call(arguments);
|
|
const options = args.length > 1 ? args[1] : {};
|
|
const signal = options == null ? void 0 : options.signal;
|
|
const ac = new AbortController();
|
|
const fetchSignal = ac.signal;
|
|
options.signal = fetchSignal;
|
|
args[1] = options;
|
|
let onAbort;
|
|
if (signal) {
|
|
const nativeAddEventListener = signal[Zone3.__symbol__("addEventListener")] || signal.addEventListener;
|
|
onAbort = () => ac.abort();
|
|
nativeAddEventListener.call(signal, "abort", onAbort, { once: true });
|
|
}
|
|
return createFetchTask("fetch", { fetchArgs: args }, fetch, this, args, ac).finally(() => {
|
|
signal == null ? void 0 : signal.removeEventListener("abort", onAbort);
|
|
});
|
|
};
|
|
if (OriginalResponse == null ? void 0 : OriginalResponse.prototype) {
|
|
["arrayBuffer", "blob", "formData", "json", "text"].filter((method) => typeof OriginalResponse.prototype[method] === "function").forEach((method) => {
|
|
api.patchMethod(OriginalResponse.prototype, method, (delegate) => (self, args) => createFetchTask(`Response.${method}`, void 0, delegate, self, args, void 0));
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
// packages/zone.js/lib/common/rollup-fetch.js
|
|
patchFetch(Zone);
|