Skip to content

Commit

Permalink
Merge branch 'main' into ts-migrate/victory-pie
Browse files Browse the repository at this point in the history
  • Loading branch information
KenanYusuf committed Jan 25, 2024
2 parents 5ddf435 + 0c9b7f1 commit 809fa82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ describe("components/victory-errorbar", () => {
it("renders an svg with the correct width and height", () => {
const { container } = render(<VictoryErrorBar />);
const svg = container.querySelector("svg");
expect(svg.style.width).toEqual("100%");
expect(svg.style.height).toEqual("100%");
expect(svg!.style.width).toEqual("100%");
expect(svg!.style.height).toEqual("100%");
});

it("renders an svg with the correct viewBox", () => {
const { container } = render(<VictoryErrorBar />);
const svg = container.querySelector("svg");
const viewBoxValue = `0 0 ${450} ${300}`;
expect(svg.getAttribute("viewBox")).toEqual(viewBoxValue);
expect(svg!.getAttribute("viewBox")).toEqual(viewBoxValue);
});

it("renders 4 errors", () => {
Expand Down Expand Up @@ -104,7 +104,7 @@ describe("components/victory-errorbar", () => {
render(<VictoryErrorBar data={data} sortKey="x" {...defaultProps} />);
const xValues = screen
.getAllByTestId("error-bar")
.map((node) => parseInt(node.getAttribute("data-x")));
.map((node) => parseInt(node.getAttribute("data-x")!));
expect(xValues).toEqual([0, 1, 2, 3, 4]);
});

Expand All @@ -124,7 +124,7 @@ describe("components/victory-errorbar", () => {
);
const yValues = screen
.getAllByTestId("error-bar")
.map((node) => parseInt(node.getAttribute("data-y")));
.map((node) => parseInt(node.getAttribute("data-y")!));
expect(yValues).toEqual([4, 3, 2, 1, 0]);
});

Expand Down Expand Up @@ -1017,7 +1017,7 @@ describe("components/victory-errorbar", () => {
/>,
);
const svg = container.querySelector("svg");
fireEvent.click(svg);
fireEvent.click(svg!);
expect(clickHandler).toBeCalled();
});

Expand Down Expand Up @@ -1091,7 +1091,7 @@ describe("components/victory-errorbar", () => {
expect(g.getAttribute("aria-label")).toEqual(
`error bar chart, x ${data[i].x}`,
);
expect(parseInt(g.getAttribute("tabindex"), 10)).toEqual(i + 2);
expect(parseInt(g.getAttribute("tabindex")!, 10)).toEqual(i + 2);
});
});
});
Expand Down
1 change: 0 additions & 1 deletion packages/victory-pie/src/victory-pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export interface VictoryPieProps
const fallbackProps = {
endAngle: 360,
height: 400,
radius: 100,
innerRadius: 0,
cornerRadius: 0,
padAngle: 0,
Expand Down

0 comments on commit 809fa82

Please sign in to comment.