Skip to content

Commit

Permalink
Test center
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Jan 19, 2024
1 parent 75778e0 commit 291fed4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/victory-tooltip/src/flyout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe("victory-primitives/flyout", () => {
cornerRadius: 5,
pointerLength: 10,
pointerWidth: 10,
// center: { x: 100, y: 100 },
};
describe("rendering", () => {
it("renders a flyout path", () => {
Expand Down
10 changes: 5 additions & 5 deletions packages/victory-tooltip/src/flyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ export const Flyout: React.FC<FlyoutProps> = (initialProps) => {

// check for required props for this subcomponent
// they should be passed in from the wrapper
UserProps.assert(props.center, "Flyout props[center] is undefined");
// UserProps.assert(props.center, "Flyout props[center] is undefined");
UserProps.assert(props.height, "Flyout props[height] is undefined");
UserProps.assert(props.width, "Flyout props[width] is undefined");
UserProps.assert(props.x, "Flyout props[x] is undefined");
UserProps.assert(props.y, "Flyout props[y] is undefined");

const { x: centerX, y: centerY } = props.center;
// const { x: centerX, y: centerY } = props.center;

UserProps.assert(centerX, "Flyout props[center.x] is undefined");
UserProps.assert(centerY, "Flyout props[center.y] is undefined");
// UserProps.assert(centerX, "Flyout props[center.x] is undefined");
// UserProps.assert(centerY, "Flyout props[center.y] is undefined");

const flyoutPathProps: FlyoutPathProps = {
center: { x: centerX, y: centerY },
center: props.center,
cornerRadius: props.cornerRadius || 0,
dx: props.dx,
dy: props.dy,
Expand Down

0 comments on commit 291fed4

Please sign in to comment.