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.
67 lines
2.0 KiB
JavaScript
67 lines
2.0 KiB
JavaScript
"use strict";
|
|
/**
|
|
* This is the Posix implementation of isexe, which uses the file
|
|
* mode and uid/gid values.
|
|
*
|
|
* @module
|
|
*/
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.sync = exports.isexe = void 0;
|
|
const node_fs_1 = require("node:fs");
|
|
const promises_1 = require("node:fs/promises");
|
|
/**
|
|
* Determine whether a path is executable according to the mode and
|
|
* current (or specified) user and group IDs.
|
|
*/
|
|
const isexe = async (path, options = {}) => {
|
|
const { ignoreErrors = false } = options;
|
|
try {
|
|
return checkStat(await (0, promises_1.stat)(path), options);
|
|
}
|
|
catch (e) {
|
|
const er = e;
|
|
if (ignoreErrors || er.code === 'EACCES')
|
|
return false;
|
|
throw er;
|
|
}
|
|
};
|
|
exports.isexe = isexe;
|
|
/**
|
|
* Synchronously determine whether a path is executable according to
|
|
* the mode and current (or specified) user and group IDs.
|
|
*/
|
|
const sync = (path, options = {}) => {
|
|
const { ignoreErrors = false } = options;
|
|
try {
|
|
return checkStat((0, node_fs_1.statSync)(path), options);
|
|
}
|
|
catch (e) {
|
|
const er = e;
|
|
if (ignoreErrors || er.code === 'EACCES')
|
|
return false;
|
|
throw er;
|
|
}
|
|
};
|
|
exports.sync = sync;
|
|
const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
|
|
const checkMode = (stat, options) => {
|
|
const myUid = options.uid ?? process.getuid?.();
|
|
const myGroups = options.groups ?? process.getgroups?.() ?? [];
|
|
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
|
|
if (myUid === undefined || myGid === undefined) {
|
|
throw new Error('cannot get uid or gid');
|
|
}
|
|
const groups = new Set([myGid, ...myGroups]);
|
|
const mod = stat.mode;
|
|
const uid = stat.uid;
|
|
const gid = stat.gid;
|
|
const u = parseInt('100', 8);
|
|
const g = parseInt('010', 8);
|
|
const o = parseInt('001', 8);
|
|
const ug = u | g;
|
|
return !!(mod & o ||
|
|
(mod & g && groups.has(gid)) ||
|
|
(mod & u && uid === myUid) ||
|
|
(mod & ug && myUid === 0));
|
|
};
|
|
//# sourceMappingURL=posix.js.map
|