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.
56 lines
2.2 KiB
TypeScript
56 lines
2.2 KiB
TypeScript
/**
|
|
* Type of jitter to apply to the delay.
|
|
* - `"none"`: no jitter is applied
|
|
* - `"full"`: full jitter is applied (random value between `0` and `delay`)
|
|
*/
|
|
export declare type JitterType = "none" | "full";
|
|
export declare type BackoffOptions = Partial<IBackOffOptions>;
|
|
export interface IBackOffOptions {
|
|
/**
|
|
* Decides whether the `startingDelay` should be applied before the first call.
|
|
* If `false`, the first call will occur without a delay.
|
|
* @defaultValue `false`
|
|
*/
|
|
delayFirstAttempt: boolean;
|
|
/**
|
|
* Decides whether a [jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/)
|
|
* should be applied to the delay. Possible values are `"full"` and `"none"`.
|
|
* @defaultValue `"none"`
|
|
*/
|
|
jitter: JitterType;
|
|
/**
|
|
* The maximum delay, in milliseconds, between two consecutive attempts.
|
|
* @defaultValue `Infinity`
|
|
*/
|
|
maxDelay: number;
|
|
/**
|
|
* The maximum number of times to attempt the function.
|
|
* Must be at least `1`.
|
|
* @defaultValue `10`
|
|
*/
|
|
numOfAttempts: number;
|
|
/**
|
|
* The `retry` function can be used to run logic after every failed attempt (e.g. logging a message,
|
|
* assessing the last error, etc.).
|
|
* It is called with the last error and the upcoming attempt number.
|
|
* Returning `true` will retry the function as long as the `numOfAttempts` has not been exceeded.
|
|
* Returning `false` will end the execution.
|
|
* @defaultValue a function that always returns `true`.
|
|
* @param e The last error thrown by the function.
|
|
* @param attemptNumber The upcoming attempt number.
|
|
* @returns `true` to retry the function, `false` to end the execution
|
|
*/
|
|
retry: (e: any, attemptNumber: number) => boolean | Promise<boolean>;
|
|
/**
|
|
* The delay, in milliseconds, before executing the function for the first time.
|
|
* @defaultValue `100`
|
|
*/
|
|
startingDelay: number;
|
|
/**
|
|
* The `startingDelay` is multiplied by the `timeMultiple` to increase the delay between reattempts.
|
|
* @defaultValue `2`
|
|
*/
|
|
timeMultiple: number;
|
|
}
|
|
export declare function getSanitizedOptions(options: BackoffOptions): IBackOffOptions;
|