Skip to content

Commit

Permalink
Update outdated testing library dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot committed Nov 13, 2024
1 parent e4514a6 commit 951846b
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 582 deletions.
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,16 @@
"@storybook/react": "^8.4.1",
"@storybook/react-webpack5": "^8.4.1",
"@svitejs/changesets-changelog-github-compact": "^0.1.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.3.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/react-native": "^11.0.0",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@types/fs-extra": "^11.0.3",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.149",
"@types/node": "^18.6.1",
"@types/prop-types": "^15.7.5",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"autoprefixer": "^10.0.1",
"babel-jest": "29.7.0",
"babel-loader": "9.1.3",
Expand Down
1 change: 1 addition & 0 deletions packages/victory-core/src/victory-util/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

// TODO: Use "warning" npm module like React is switching to.
export function warn(message: string) {
// @ts-expect-error This will be replaced by webpack DefinePlugin
if (process.env.NODE_ENV !== "production") {
if (console && console.warn) {
console.warn(message);
Expand Down
54 changes: 0 additions & 54 deletions packages/victory-native/jest-native-setup.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions packages/victory-native/jest.config.ts

This file was deleted.

19 changes: 3 additions & 16 deletions packages/victory-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,9 @@
]
},
"jest": {
"command": "jest",
"files": [
"src/**/*.test.*",
"../../.babelrc.js",
"./jest.config.ts",
"./jest-native-setup.tsx"
],
"output": [],
"dependencies": [
"build:lib:cjs",
"../victory-vendor:build:lib:cjs",
"../victory-voronoi:build:lib:cjs"
],
"packageLocks": [
"pnpm-lock.yaml"
]
"command": "echo victory-native (legacy) has no tests",
"files": [],
"output": []
}
}
}
66 changes: 0 additions & 66 deletions packages/victory-native/src/components.test.ts

This file was deleted.

22 changes: 18 additions & 4 deletions packages/victory-tooltip/src/victory-tooltip.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,32 @@ describe("components/victory-tooltip", () => {

it("renders nothing when not active", () => {
render(<VictoryTooltip {...baseProps} active={false} />, {
wrapper: VictoryContainer,
wrapper: VictoryContainer as React.JSXElementConstructor<{
children: React.ReactNode;
}>,
});
const output = screen.queryByTestId(labelId);
expect(output).not.toBeInTheDocument();
});

it("renders the expected text", () => {
render(<VictoryTooltip {...baseProps} />, { wrapper: VictoryContainer });
render(<VictoryTooltip {...baseProps} />, {
wrapper: VictoryContainer as React.JSXElementConstructor<{
children: React.ReactNode;
}>,
});
const output = screen.getByTestId(labelId);
expect(output).toBeInTheDocument();
expect(output).toBeVisible();
expect(output).toHaveTextContent(baseProps.text);
});

it("renders a flyout and a label", () => {
render(<VictoryTooltip {...baseProps} />, { wrapper: VictoryContainer });
render(<VictoryTooltip {...baseProps} />, {
wrapper: VictoryContainer as React.JSXElementConstructor<{
children: React.ReactNode;
}>,
});
const label = screen.getByTestId(labelId);
const flyout = screen.getByTestId(flyoutId);
expect(label).toBeInTheDocument();
Expand All @@ -49,7 +59,11 @@ describe("components/victory-tooltip", () => {
const clickHandler = jest.fn();
render(
<VictoryTooltip {...baseProps} events={{ onClick: clickHandler }} />,
{ wrapper: VictoryContainer },
{
wrapper: VictoryContainer as React.JSXElementConstructor<{
children: React.ReactNode;
}>,
},
);
fireEvent.click(screen.getByTestId(flyoutId));
expect(clickHandler).toBeCalled();
Expand Down
Loading

0 comments on commit 951846b

Please sign in to comment.