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.
2 lines
4.0 KiB
JavaScript
2 lines
4.0 KiB
JavaScript
import*as e from"react";import{PrimeReactContext as t}from"primereact/api";import{ComponentBase as n,useHandleStyle as r}from"primereact/componentbase";import{useMergeProps as o,useMountEffect as i}from"primereact/hooks";import{Tooltip as l}from"primereact/tooltip";import{classNames as u,DomHandler as a,ObjectUtils as c}from"primereact/utils";function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(null,arguments)}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function m(e){var t=f(e,"string");return"symbol"==s(t)?t:t+""}function d(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b=n.extend({defaultProps:{__TYPE:"InputSwitch",autoFocus:!1,checked:!1,className:null,disabled:!1,falseValue:!1,id:null,inputId:null,inputRef:null,invalid:!1,name:null,onBlur:null,onChange:null,onFocus:null,style:null,tabIndex:null,tooltip:null,tooltipOptions:null,trueValue:!0,children:void 0},css:{classes:{root:function(e){var t=e.props;return u("p-inputswitch p-component",{"p-highlight":e.checked,"p-disabled":t.disabled,"p-invalid":t.invalid})},input:"p-inputswitch-input",slider:"p-inputswitch-slider"}}});function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=e.memo(e.forwardRef((function(n,s){var f=o(),m=e.useContext(t),d=b.getProps(n,m),y=b.setMetaData({props:d}),h=y.ptm,g=y.cx;r(b.css.styles,y.isUnstyled,{name:"inputswitch"});var O=e.useRef(null),P=e.useRef(d.inputRef),w=d.checked===d.trueValue;e.useImperativeHandle(s,(function(){return{props:d,focus:function(){return a.focus(P.current)},getElement:function(){return O.current},getInput:function(){return P.current}}})),e.useEffect((function(){c.combinedRefs(P,d.inputRef)}),[P,d.inputRef]),i((function(){d.autoFocus&&a.focus(P.current,d.autoFocus)}));var j=c.isNotEmpty(d.tooltip),E=b.getOtherProps(d),S=c.reduceKeys(E,a.ARIA_PROPS),k=f({className:u(d.className,g("root",{checked:w})),style:d.style,role:"checkbox","aria-checked":w,"data-p-highlight":w,"data-p-disabled":d.disabled},E,h("root")),I=f(v({type:"checkbox",id:d.inputId,name:d.name,checked:w,onChange:function(e){if(d.onChange){var t=w?d.falseValue:d.trueValue;d.onChange({originalEvent:e,value:t,stopPropagation:function(){null==e||e.stopPropagation()},preventDefault:function(){null==e||e.preventDefault()},target:{name:d.name,id:d.id,value:t}})}},onFocus:function(e){var t;null==d||null===(t=d.onFocus)||void 0===t||t.call(d,e)},onBlur:function(e){var t;null==d||null===(t=d.onBlur)||void 0===t||t.call(d,e)},disabled:d.disabled,role:"switch",tabIndex:d.tabIndex,"aria-checked":w,className:g("input")},S),h("input")),R=f({className:g("slider")},h("slider"));return e.createElement(e.Fragment,null,e.createElement("div",p({id:d.id,ref:O},k),e.createElement("input",p({ref:P},I)),e.createElement("span",R)),j&&e.createElement(l,p({target:O,content:d.tooltip,pt:h("tooltip")},d.tooltipOptions)))})));h.displayName="InputSwitch";export{h as InputSwitch};
|