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.
53 lines
1.5 KiB
JavaScript
53 lines
1.5 KiB
JavaScript
var castPath = require('./_castPath'),
|
|
last = require('./last'),
|
|
parent = require('./_parent'),
|
|
toKey = require('./_toKey');
|
|
|
|
/** Used for built-in method references. */
|
|
var objectProto = Object.prototype;
|
|
|
|
/** Used to check objects for own properties. */
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
|
/**
|
|
* The base implementation of `_.unset`.
|
|
*
|
|
* @private
|
|
* @param {Object} object The object to modify.
|
|
* @param {Array|string} path The property path to unset.
|
|
* @returns {boolean} Returns `true` if the property is deleted, else `false`.
|
|
*/
|
|
function baseUnset(object, path) {
|
|
path = castPath(path, object);
|
|
|
|
// Prevent prototype pollution:
|
|
// https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
// https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh
|
|
var index = -1,
|
|
length = path.length;
|
|
|
|
if (!length) {
|
|
return true;
|
|
}
|
|
|
|
while (++index < length) {
|
|
var key = toKey(path[index]);
|
|
|
|
// Always block "__proto__" anywhere in the path if it's not expected
|
|
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
return false;
|
|
}
|
|
|
|
// Block constructor/prototype as non-terminal traversal keys to prevent
|
|
// escaping the object graph into built-in constructors and prototypes.
|
|
if ((key === 'constructor' || key === 'prototype') && index < length - 1) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var obj = parent(object, path);
|
|
return obj == null || delete obj[toKey(last(path))];
|
|
}
|
|
|
|
module.exports = baseUnset;
|