You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test selects the donut toggle checkbox using a hidden role-based query, which is fragile and may break with markup changes. Consider adding an accessible label or data-testid to make the selector more reliable.
/** * BUG The label element associated with checkbox inputs must have an htmlFor attribute that corresponds to the id of the checkbox. This ensures proper accessibility support and allows assistive technologies to correctly associate labels with form elements. */consttoggleSwitch=screen.getByRole("checkbox",{hidden: true});//workaround for getting checkbox// screen.debug();expect(toggleSwitch).not.toBeChecked();fireEvent.click(toggleSwitch);expect(toggleSwitch).toBeChecked();expect(result.current.data.option.series[0].radius).toEqual(["20%","50%"]);
The customRenderHook wrapper injects both and children, but the provider hierarchy and initialProps usage may lead to unexpected hook context. Verify that useBlock and useBlockSettings hooks receive the correct context.
-import { ToogleDonut } from "@/components/block-defaults/echart-visualization-block/variant/pie-chart/ToggleDonut";+import { ToggleDonut } from "@/components/block-defaults/echart-visualization-block/variant/pie-chart/ToggleDonut";
Suggestion importance[1-10]: 8
__
Why: The test uses <ToogleDonut> but the actual component export is ToggleDonut; correcting this prevents import failures and broken tests.
Medium
Simplify hook render wrapper
Avoid spreading unexpected props into your provider wrapper. Use the captured blocks, queryConfig, and renderEngineId directly and accept only children in the wrapper signature.
Why: Restricting the wrapper signature to only children and using captured props streamlines the code, but this is a minor stylistic improvement.
Low
Possible issue
Use boolean for show flag
The show flag is declared as a string but should be a boolean to match ECharts' configuration types. Convert "true" to true for proper rendering behavior.
Why: Changing show from a string to a boolean corrects the type and aligns with ECharts’ expected configuration, preventing potential rendering issues.
PieChart block tests for rendering, settings, and donut toggle
to commit the new content to the CHANGELOG.md file, please type:
'/update_changelog --pr_update_changelog.push_changelog_changes=true'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes Made
How to Test
Notes