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.
92 lines
1.8 KiB
JavaScript
92 lines
1.8 KiB
JavaScript
const process = require('node:process')
|
|
const nodeOs = require('node:os')
|
|
const fs = require('node:fs')
|
|
|
|
function isMusl (file) {
|
|
return file.includes('libc.musl-') || file.includes('ld-musl-')
|
|
}
|
|
|
|
function os () {
|
|
return process.platform
|
|
}
|
|
|
|
function cpu () {
|
|
return process.arch
|
|
}
|
|
|
|
const LDD_PATH = '/usr/bin/ldd'
|
|
function getFamilyFromFilesystem () {
|
|
try {
|
|
const content = fs.readFileSync(LDD_PATH, 'utf-8')
|
|
if (content.includes('musl')) {
|
|
return 'musl'
|
|
}
|
|
if (content.includes('GNU C Library')) {
|
|
return 'glibc'
|
|
}
|
|
return null
|
|
} catch {
|
|
return undefined
|
|
}
|
|
}
|
|
|
|
function getFamilyFromReport () {
|
|
const originalExclude = process.report.excludeNetwork
|
|
process.report.excludeNetwork = true
|
|
const report = process.report.getReport()
|
|
process.report.excludeNetwork = originalExclude
|
|
if (report.header?.glibcVersionRuntime) {
|
|
family = 'glibc'
|
|
} else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) {
|
|
family = 'musl'
|
|
} else {
|
|
family = null
|
|
}
|
|
return family
|
|
}
|
|
|
|
let family
|
|
function libc (osName) {
|
|
if (osName !== 'linux') {
|
|
return undefined
|
|
}
|
|
if (family === undefined) {
|
|
family = getFamilyFromFilesystem()
|
|
if (family === undefined) {
|
|
family = getFamilyFromReport()
|
|
}
|
|
}
|
|
return family
|
|
}
|
|
|
|
function devEngines (env = {}) {
|
|
const osName = env.os || os()
|
|
return {
|
|
cpu: {
|
|
name: env.cpu || cpu(),
|
|
},
|
|
libc: {
|
|
name: env.libc || libc(osName),
|
|
},
|
|
os: {
|
|
name: osName,
|
|
version: env.osVersion || nodeOs.release(),
|
|
},
|
|
packageManager: {
|
|
name: 'npm',
|
|
version: env.npmVersion,
|
|
},
|
|
runtime: {
|
|
name: 'node',
|
|
version: env.nodeVersion || process.version,
|
|
},
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
cpu,
|
|
libc,
|
|
os,
|
|
devEngines,
|
|
}
|