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.
184 lines
5.9 KiB
JavaScript
184 lines
5.9 KiB
JavaScript
import { __extends } from "tslib";
|
|
import { isFunction } from './util/isFunction';
|
|
import { isSubscription, Subscription } from './Subscription';
|
|
import { config } from './config';
|
|
import { reportUnhandledError } from './util/reportUnhandledError';
|
|
import { noop } from './util/noop';
|
|
import { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';
|
|
import { timeoutProvider } from './scheduler/timeoutProvider';
|
|
import { captureError } from './util/errorContext';
|
|
var Subscriber = (function (_super) {
|
|
__extends(Subscriber, _super);
|
|
function Subscriber(destination) {
|
|
var _this = _super.call(this) || this;
|
|
_this.isStopped = false;
|
|
if (destination) {
|
|
_this.destination = destination;
|
|
if (isSubscription(destination)) {
|
|
destination.add(_this);
|
|
}
|
|
}
|
|
else {
|
|
_this.destination = EMPTY_OBSERVER;
|
|
}
|
|
return _this;
|
|
}
|
|
Subscriber.create = function (next, error, complete) {
|
|
return new SafeSubscriber(next, error, complete);
|
|
};
|
|
Subscriber.prototype.next = function (value) {
|
|
if (this.isStopped) {
|
|
handleStoppedNotification(nextNotification(value), this);
|
|
}
|
|
else {
|
|
this._next(value);
|
|
}
|
|
};
|
|
Subscriber.prototype.error = function (err) {
|
|
if (this.isStopped) {
|
|
handleStoppedNotification(errorNotification(err), this);
|
|
}
|
|
else {
|
|
this.isStopped = true;
|
|
this._error(err);
|
|
}
|
|
};
|
|
Subscriber.prototype.complete = function () {
|
|
if (this.isStopped) {
|
|
handleStoppedNotification(COMPLETE_NOTIFICATION, this);
|
|
}
|
|
else {
|
|
this.isStopped = true;
|
|
this._complete();
|
|
}
|
|
};
|
|
Subscriber.prototype.unsubscribe = function () {
|
|
if (!this.closed) {
|
|
this.isStopped = true;
|
|
_super.prototype.unsubscribe.call(this);
|
|
this.destination = null;
|
|
}
|
|
};
|
|
Subscriber.prototype._next = function (value) {
|
|
this.destination.next(value);
|
|
};
|
|
Subscriber.prototype._error = function (err) {
|
|
try {
|
|
this.destination.error(err);
|
|
}
|
|
finally {
|
|
this.unsubscribe();
|
|
}
|
|
};
|
|
Subscriber.prototype._complete = function () {
|
|
try {
|
|
this.destination.complete();
|
|
}
|
|
finally {
|
|
this.unsubscribe();
|
|
}
|
|
};
|
|
return Subscriber;
|
|
}(Subscription));
|
|
export { Subscriber };
|
|
var _bind = Function.prototype.bind;
|
|
function bind(fn, thisArg) {
|
|
return _bind.call(fn, thisArg);
|
|
}
|
|
var ConsumerObserver = (function () {
|
|
function ConsumerObserver(partialObserver) {
|
|
this.partialObserver = partialObserver;
|
|
}
|
|
ConsumerObserver.prototype.next = function (value) {
|
|
var partialObserver = this.partialObserver;
|
|
if (partialObserver.next) {
|
|
try {
|
|
partialObserver.next(value);
|
|
}
|
|
catch (error) {
|
|
handleUnhandledError(error);
|
|
}
|
|
}
|
|
};
|
|
ConsumerObserver.prototype.error = function (err) {
|
|
var partialObserver = this.partialObserver;
|
|
if (partialObserver.error) {
|
|
try {
|
|
partialObserver.error(err);
|
|
}
|
|
catch (error) {
|
|
handleUnhandledError(error);
|
|
}
|
|
}
|
|
else {
|
|
handleUnhandledError(err);
|
|
}
|
|
};
|
|
ConsumerObserver.prototype.complete = function () {
|
|
var partialObserver = this.partialObserver;
|
|
if (partialObserver.complete) {
|
|
try {
|
|
partialObserver.complete();
|
|
}
|
|
catch (error) {
|
|
handleUnhandledError(error);
|
|
}
|
|
}
|
|
};
|
|
return ConsumerObserver;
|
|
}());
|
|
var SafeSubscriber = (function (_super) {
|
|
__extends(SafeSubscriber, _super);
|
|
function SafeSubscriber(observerOrNext, error, complete) {
|
|
var _this = _super.call(this) || this;
|
|
var partialObserver;
|
|
if (isFunction(observerOrNext) || !observerOrNext) {
|
|
partialObserver = {
|
|
next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),
|
|
error: error !== null && error !== void 0 ? error : undefined,
|
|
complete: complete !== null && complete !== void 0 ? complete : undefined,
|
|
};
|
|
}
|
|
else {
|
|
var context_1;
|
|
if (_this && config.useDeprecatedNextContext) {
|
|
context_1 = Object.create(observerOrNext);
|
|
context_1.unsubscribe = function () { return _this.unsubscribe(); };
|
|
partialObserver = {
|
|
next: observerOrNext.next && bind(observerOrNext.next, context_1),
|
|
error: observerOrNext.error && bind(observerOrNext.error, context_1),
|
|
complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),
|
|
};
|
|
}
|
|
else {
|
|
partialObserver = observerOrNext;
|
|
}
|
|
}
|
|
_this.destination = new ConsumerObserver(partialObserver);
|
|
return _this;
|
|
}
|
|
return SafeSubscriber;
|
|
}(Subscriber));
|
|
export { SafeSubscriber };
|
|
function handleUnhandledError(error) {
|
|
if (config.useDeprecatedSynchronousErrorHandling) {
|
|
captureError(error);
|
|
}
|
|
else {
|
|
reportUnhandledError(error);
|
|
}
|
|
}
|
|
function defaultErrorHandler(err) {
|
|
throw err;
|
|
}
|
|
function handleStoppedNotification(notification, subscriber) {
|
|
var onStoppedNotification = config.onStoppedNotification;
|
|
onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });
|
|
}
|
|
export var EMPTY_OBSERVER = {
|
|
closed: true,
|
|
next: noop,
|
|
error: defaultErrorHandler,
|
|
complete: noop,
|
|
};
|
|
//# sourceMappingURL=Subscriber.js.map
|