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.
131 lines
2.5 KiB
TypeScript
131 lines
2.5 KiB
TypeScript
import {SchemaObject} from "../types"
|
|
|
|
type MetaSchema = (root: boolean) => SchemaObject
|
|
|
|
const shared: MetaSchema = (root) => {
|
|
const sch: SchemaObject = {
|
|
nullable: {type: "boolean"},
|
|
metadata: {
|
|
optionalProperties: {
|
|
union: {elements: {ref: "schema"}},
|
|
},
|
|
additionalProperties: true,
|
|
},
|
|
}
|
|
if (root) sch.definitions = {values: {ref: "schema"}}
|
|
return sch
|
|
}
|
|
|
|
const emptyForm: MetaSchema = (root) => ({
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const refForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
ref: {type: "string"},
|
|
},
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const typeForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
type: {
|
|
enum: [
|
|
"boolean",
|
|
"timestamp",
|
|
"string",
|
|
"float32",
|
|
"float64",
|
|
"int8",
|
|
"uint8",
|
|
"int16",
|
|
"uint16",
|
|
"int32",
|
|
"uint32",
|
|
],
|
|
},
|
|
},
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const enumForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
enum: {elements: {type: "string"}},
|
|
},
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const elementsForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
elements: {ref: "schema"},
|
|
},
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const propertiesForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
properties: {values: {ref: "schema"}},
|
|
},
|
|
optionalProperties: {
|
|
optionalProperties: {values: {ref: "schema"}},
|
|
additionalProperties: {type: "boolean"},
|
|
...shared(root),
|
|
},
|
|
})
|
|
|
|
const optionalPropertiesForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
optionalProperties: {values: {ref: "schema"}},
|
|
},
|
|
optionalProperties: {
|
|
additionalProperties: {type: "boolean"},
|
|
...shared(root),
|
|
},
|
|
})
|
|
|
|
const discriminatorForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
discriminator: {type: "string"},
|
|
mapping: {
|
|
values: {
|
|
metadata: {
|
|
union: [propertiesForm(false), optionalPropertiesForm(false)],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const valuesForm: MetaSchema = (root) => ({
|
|
properties: {
|
|
values: {ref: "schema"},
|
|
},
|
|
optionalProperties: shared(root),
|
|
})
|
|
|
|
const schema: MetaSchema = (root) => ({
|
|
metadata: {
|
|
union: [
|
|
emptyForm,
|
|
refForm,
|
|
typeForm,
|
|
enumForm,
|
|
elementsForm,
|
|
propertiesForm,
|
|
optionalPropertiesForm,
|
|
discriminatorForm,
|
|
valuesForm,
|
|
].map((s) => s(root)),
|
|
},
|
|
})
|
|
|
|
const jtdMetaSchema: SchemaObject = {
|
|
definitions: {
|
|
schema: schema(false),
|
|
},
|
|
...schema(true),
|
|
}
|
|
|
|
export default jtdMetaSchema
|