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
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
import*as t from"react";import{PrimeReactContext as e}from"primereact/api";import{ComponentBase as r,useHandleStyle as n}from"primereact/componentbase";import{useMergeProps as a,useUnmountEffect as u}from"primereact/hooks";import{classNames as o}from"primereact/utils";var i=r.extend({defaultProps:{__TYPE:"Chart",id:null,type:null,data:null,options:null,plugins:null,width:null,height:null,style:null,className:null,children:void 0},css:{classes:{root:"p-chart"},inlineStyles:{root:function(t){var e=t.props;return Object.assign({width:e.width,height:e.height},e.style)}},styles:"\n @layer primereact {\n .p-chart {\n position: relative\n }\n }\n "}}),s=function(){try{return Chart}catch(t){return null}}(),l=t.memo(t.forwardRef((function(r,l){var c=a(),p=t.useContext(e),f=i.getProps(r,p),m=i.setMetaData({props:f}),h=m.ptm,d=m.cx,g=m.sx;n(i.css.styles,m.isUnstyled,{name:"chart"});var y=t.useRef(null),v=t.useRef(null),w=t.useRef(null),C=function(){x();var t={type:f.type,data:f.data,options:f.options,plugins:f.plugins};s?v.current=new s(w.current,t):import("chart.js/auto").then((function(e){x(),w.current&&e&&(v.current=e.default?new e.default(w.current,t):new e(w.current,t))}))},x=function(){v.current&&(v.current.destroy(),v.current=null)};t.useImperativeHandle(l,(function(){return{props:f,getCanvas:function(){return w.current},getChart:function(){return v.current},getBase64Image:function(){return v.current.toBase64Image()},getElement:function(){return y.current},generateLegend:function(){return v.current&&v.current.generateLegend()},refresh:function(){return v.current&&v.current.update()}}})),t.useEffect((function(){C()})),u((function(){x()}));var E=f.ariaLabel||f.options&&f.options.plugins&&f.options.plugins.title&&f.options.plugins.title.text,b=c({id:f.id,ref:y,style:g("root"),className:o(f.className,d("root"))},i.getOtherProps(f),h("root")),N=c({ref:w,width:f.width,height:f.height,role:"img","aria-label":E},h("canvas"));return t.createElement("div",b,t.createElement("canvas",N))})),(function(t,e){return t.data===e.data&&t.options===e.options&&t.type===e.type}));l.displayName="Chart";export{l as Chart};
|