Skip to content

Commit

Permalink
fix: Update types and formatting in Chart widget
Browse files Browse the repository at this point in the history
  • Loading branch information
devin-ai-integration[bot] and rahulbarwal committed Jan 20, 2025
1 parent 1bd2352 commit 3e7fca5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/client/src/widgets/ChartWidget/widget/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,20 @@ describe("emptyChartData", () => {
it("uses theme font family with Nunito Sans fallback", () => {
const widget = new ChartWidget(defaultProps);
const view = widget.renderChartWithData();

expect(view.props.children.props.fontFamily).toEqual("fontfamily");

const propsWithoutFont: ChartWidgetProps = {
...defaultProps,
fontFamily: undefined as unknown as string, // Type assertion needed since fontFamily is required in props
fontFamily: undefined as unknown as string,
};
const viewWithoutFont = new ChartWidget(propsWithoutFont).renderChartWithData();
expect(viewWithoutFont.props.children.props.fontFamily).toEqual("Nunito Sans");
const viewWithoutFont = new ChartWidget(
propsWithoutFont,
).renderChartWithData();

expect(viewWithoutFont.props.children.props.fontFamily).toEqual(
"Nunito Sans",
);
});
});

Expand Down

0 comments on commit 3e7fca5

Please sign in to comment.