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.
88 lines
3.4 KiB
JavaScript
88 lines
3.4 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getDisplayName = getDisplayName;
|
|
exports.hasLoadedNamespace = hasLoadedNamespace;
|
|
exports.loadLanguages = loadLanguages;
|
|
exports.loadNamespaces = loadNamespaces;
|
|
exports.warn = warn;
|
|
exports.warnOnce = warnOnce;
|
|
function warn() {
|
|
if (console && console.warn) {
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
|
|
console.warn(...args);
|
|
}
|
|
}
|
|
const alreadyWarned = {};
|
|
function warnOnce() {
|
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
args[_key2] = arguments[_key2];
|
|
}
|
|
if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
|
|
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
|
warn(...args);
|
|
}
|
|
const loadedClb = (i18n, cb) => () => {
|
|
if (i18n.isInitialized) {
|
|
cb();
|
|
} else {
|
|
const initialized = () => {
|
|
setTimeout(() => {
|
|
i18n.off('initialized', initialized);
|
|
}, 0);
|
|
cb();
|
|
};
|
|
i18n.on('initialized', initialized);
|
|
}
|
|
};
|
|
function loadNamespaces(i18n, ns, cb) {
|
|
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
}
|
|
function loadLanguages(i18n, lng, ns, cb) {
|
|
if (typeof ns === 'string') ns = [ns];
|
|
ns.forEach(n => {
|
|
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
});
|
|
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
}
|
|
function oldI18nextHasLoadedNamespace(ns, i18n) {
|
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
const lng = i18n.languages[0];
|
|
const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
|
const lastLng = i18n.languages[i18n.languages.length - 1];
|
|
if (lng.toLowerCase() === 'cimode') return true;
|
|
const loadNotPending = (l, n) => {
|
|
const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
|
|
return loadState === -1 || loadState === 2;
|
|
};
|
|
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
|
if (i18n.hasResourceBundle(lng, ns)) return true;
|
|
if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
|
|
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
|
return false;
|
|
}
|
|
function hasLoadedNamespace(ns, i18n) {
|
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
if (!i18n.languages || !i18n.languages.length) {
|
|
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
|
return true;
|
|
}
|
|
const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
|
|
if (!isNewerI18next) {
|
|
return oldI18nextHasLoadedNamespace(ns, i18n, options);
|
|
}
|
|
return i18n.hasLoadedNamespace(ns, {
|
|
lng: options.lng,
|
|
precheck: (i18nInstance, loadNotPending) => {
|
|
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
|
|
}
|
|
});
|
|
}
|
|
function getDisplayName(Component) {
|
|
return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
|
|
} |