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.
80 lines
2.2 KiB
TypeScript
80 lines
2.2 KiB
TypeScript
import { Observable } from '../Observable';
|
|
import { SchedulerLike } from '../types';
|
|
|
|
/**
|
|
* A simple Observable that emits no items to the Observer and immediately
|
|
* emits a complete notification.
|
|
*
|
|
* <span class="informal">Just emits 'complete', and nothing else.</span>
|
|
*
|
|
* 
|
|
*
|
|
* A simple Observable that only emits the complete notification. It can be used
|
|
* for composing with other Observables, such as in a {@link mergeMap}.
|
|
*
|
|
* ## Examples
|
|
*
|
|
* Log complete notification
|
|
*
|
|
* ```ts
|
|
* import { EMPTY } from 'rxjs';
|
|
*
|
|
* EMPTY.subscribe({
|
|
* next: () => console.log('Next'),
|
|
* complete: () => console.log('Complete!')
|
|
* });
|
|
*
|
|
* // Outputs
|
|
* // Complete!
|
|
* ```
|
|
*
|
|
* Emit the number 7, then complete
|
|
*
|
|
* ```ts
|
|
* import { EMPTY, startWith } from 'rxjs';
|
|
*
|
|
* const result = EMPTY.pipe(startWith(7));
|
|
* result.subscribe(x => console.log(x));
|
|
*
|
|
* // Outputs
|
|
* // 7
|
|
* ```
|
|
*
|
|
* Map and flatten only odd numbers to the sequence `'a'`, `'b'`, `'c'`
|
|
*
|
|
* ```ts
|
|
* import { interval, mergeMap, of, EMPTY } from 'rxjs';
|
|
*
|
|
* const interval$ = interval(1000);
|
|
* const result = interval$.pipe(
|
|
* mergeMap(x => x % 2 === 1 ? of('a', 'b', 'c') : EMPTY),
|
|
* );
|
|
* result.subscribe(x => console.log(x));
|
|
*
|
|
* // Results in the following to the console:
|
|
* // x is equal to the count on the interval, e.g. (0, 1, 2, 3, ...)
|
|
* // x will occur every 1000ms
|
|
* // if x % 2 is equal to 1, print a, b, c (each on its own)
|
|
* // if x % 2 is not equal to 1, nothing will be output
|
|
* ```
|
|
*
|
|
* @see {@link Observable}
|
|
* @see {@link NEVER}
|
|
* @see {@link of}
|
|
* @see {@link throwError}
|
|
*/
|
|
export const EMPTY = new Observable<never>((subscriber) => subscriber.complete());
|
|
|
|
/**
|
|
* @param scheduler A {@link SchedulerLike} to use for scheduling
|
|
* the emission of the complete notification.
|
|
* @deprecated Replaced with the {@link EMPTY} constant or {@link scheduled} (e.g. `scheduled([], scheduler)`). Will be removed in v8.
|
|
*/
|
|
export function empty(scheduler?: SchedulerLike) {
|
|
return scheduler ? emptyScheduled(scheduler) : EMPTY;
|
|
}
|
|
|
|
function emptyScheduled(scheduler: SchedulerLike) {
|
|
return new Observable<never>((subscriber) => scheduler.schedule(() => subscriber.complete()));
|
|
}
|