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.
91 lines
5.2 KiB
JavaScript
91 lines
5.2 KiB
JavaScript
'use strict'
|
|
|
|
const test = require('tape')
|
|
const fastURI = require('..')
|
|
|
|
test('RFC 3986', (t) => {
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
|
|
// A. If the input buffer begins with a prefix of "../" or "./",
|
|
// then remove that prefix from the input buffer; otherwise,
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../../', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '././', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './../', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '.././', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '../../foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '././foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: './../foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '.././foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
|
|
// B. if the input buffer begins with a prefix of "/./" or "/.",
|
|
// where "." is a complete path segment, then replace that
|
|
// prefix with "/" in the input buffer; otherwise,
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/./', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/.', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/./foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/.././foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
|
|
// C. if the input buffer begins with a prefix of "/../" or "/..",
|
|
// where ".." is a complete path segment, then replace that
|
|
// prefix with "/" in the input buffer and remove the last
|
|
// segment and its preceding "/" (if any) from the output
|
|
// buffer; otherwise,
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/../', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/..', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/../foo', secure: true }),
|
|
'http://example.com/foo', 'http://example.com/foo')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo/..', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo/bar/..', secure: true }),
|
|
'http://example.com/foo/', 'http://example.com/foo/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/foo/../bar/..', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
|
|
// D. if the input buffer consists only of "." or "..", then remove
|
|
// that from the input buffer; otherwise,
|
|
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/.', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '/..', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '.', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
t.strictEqual(fastURI.serialize({ scheme: 'http', host: 'example.com', path: '..', secure: true }),
|
|
'http://example.com/', 'http://example.com/')
|
|
|
|
t.end()
|
|
})
|