TARUNTEjjjj commented on code in PR #21836: URL: https://github.com/apache/echarts/pull/21836#discussion_r4693538946
########## test/ut/spec/util/types.test.ts: ########## @@ -0,0 +1,64 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* 'License'); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +import { CallbackDataParams } from '@/src/util/types'; + +describe('util/types', function () { + describe('CallbackDataParams', function () { + it('should allow accessing axis context properties without type assertions', function () { + const params: CallbackDataParams = { + componentType: 'series', + componentSubType: 'line', + componentIndex: 0, + seriesType: 'line', + seriesIndex: 0, + seriesId: 'series_0', + seriesName: 'Sales', + name: 'Monday', + dataIndex: 1, + data: 120, + value: 120, + $vars: ['name', 'value'], + axisDim: 'x', + axisIndex: 0, + axisType: 'categoryAxis', Review Comment: Checked the updated head (`48f73be`) locally: - `test/ut/spec/util/types.test.ts` now aligns with runtime shapes (`axisType: 'xAxis.category'`, `axisValue: 'Monday'`) and covers numeric (`xAxis.value`) and timestamp (`xAxis.time`) axes. - `npm run checktype`, `npm run lint`, `npm run checkheader`, `npm run build:lib`, and the Jest UT suite (`27` suites / `196` tests, including both `CallbackDataParams` tests) all pass. - Re-checked live `echarts.init(..., { renderer: 'svg' })` + `dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: 1 })` in jsdom (with `HTMLCanvasElement.prototype.getContext` stubbed for `measureText`) across `category`, `value`, and `time` x-axes; runtime `axisDim`, `axisIndex`, `axisType`, `axisId`, `axisValue`, and `axisValueLabel` match the updated declarations and test fixtures. *(AI-assisted validation; full browser visual suite was not run.)* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
