Skip to content

Commit 1942c2b

Browse files
authored
feat(deps): update to latest deps, improve oob tests (#90)
1 parent 6678f89 commit 1942c2b

File tree

6 files changed

+3685
-1003
lines changed

6 files changed

+3685
-1003
lines changed

package-lock.json

Lines changed: 3639 additions & 973 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@
2323
"build:storybook": "build-storybook"
2424
},
2525
"devDependencies": {
26-
"@storybook/addon-actions": "^5.3.18",
27-
"@storybook/addon-info": "^5.3.18",
28-
"@storybook/addon-links": "^5.3.18",
29-
"@storybook/addons": "^5.3.18",
30-
"@storybook/react": "^5.3.18",
26+
"@storybook/addon-actions": "^5.3.19",
27+
"@storybook/addon-info": "^5.3.19",
28+
"@storybook/addon-links": "^5.3.19",
29+
"@storybook/addons": "^5.3.19",
30+
"@storybook/react": "^5.3.19",
3131
"@types/enzyme": "^3.10.5",
3232
"@types/enzyme-adapter-react-16": "^1.0.6",
33-
"@types/jest": "^25.2.2",
33+
"@types/jest": "^25.2.3",
3434
"@types/victory": "^33.1.4",
35-
"@typescript-eslint/eslint-plugin": "^2.33.0",
36-
"@typescript-eslint/parser": "^2.33.0",
35+
"@typescript-eslint/eslint-plugin": "^3.1.0",
36+
"@typescript-eslint/parser": "^3.1.0",
3737
"css-loader": "^3.5.3",
3838
"dotenv-webpack": "^1.8.0",
3939
"enzyme": "^3.7.0",
4040
"enzyme-adapter-react-16": "^1.15.1",
41-
"enzyme-to-json": "^3.4.4",
42-
"eslint": "^7.0.0",
41+
"enzyme-to-json": "^3.5.0",
42+
"eslint": "^7.1.0",
4343
"eslint-plugin-react": "^7.20.0",
44-
"eslint-plugin-react-hooks": "^4.0.2",
44+
"eslint-plugin-react-hooks": "^4.0.4",
4545
"file-loader": "^6.0.0",
4646
"html-webpack-plugin": "^4.3.0",
4747
"imagemin": "^7.0.0",
@@ -57,25 +57,25 @@
5757
"regenerator-runtime": "^0.13.5",
5858
"rimraf": "^3.0.2",
5959
"style-loader": "^1.2.1",
60-
"svg-url-loader": "^5.0.0",
61-
"terser-webpack-plugin": "^3.0.1",
62-
"ts-jest": "^26.0.0",
63-
"ts-loader": "^7.0.4",
60+
"svg-url-loader": "^6.0.0",
61+
"terser-webpack-plugin": "^3.0.2",
62+
"ts-jest": "^26.1.0",
63+
"ts-loader": "^7.0.5",
6464
"tsconfig-paths-webpack-plugin": "^3.2.0",
6565
"tslib": "^2.0.0",
66-
"typescript": "^3.9.2",
66+
"typescript": "^3.9.3",
6767
"url-loader": "^4.1.0",
6868
"webpack": "^4.43.0",
69-
"webpack-bundle-analyzer": "^3.7.0",
69+
"webpack-bundle-analyzer": "^3.8.0",
7070
"webpack-cli": "^3.3.11",
7171
"webpack-dev-server": "^3.11.0",
7272
"webpack-merge": "^4.1.4"
7373
},
7474
"dependencies": {
75-
"@patternfly/react-core": "^4.15.0",
76-
"@patternfly/react-icons": "^4.3.0",
77-
"@patternfly/react-styles": "^4.3.0",
78-
"express": "^4.13.4",
75+
"@patternfly/react-core": "^4.18.1",
76+
"@patternfly/react-icons": "^4.3.2",
77+
"@patternfly/react-styles": "^4.3.2",
78+
"express": "^4.17.1",
7979
"react": "^16.13.1",
8080
"react-dom": "^16.13.1",
8181
"react-router-last-location": "^2.0.1"

src/app/Dashboard/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { PageSection, Title } from '@patternfly/react-core';
33

4-
const Dashboard: React.FunctionComponent<{}> = () => (
4+
const Dashboard: React.FunctionComponent = () => (
55
<PageSection>
66
<Title headingLevel="h1" size="lg">Dashboard Page Title</Title>
77
</PageSection>

src/app/DynamicImport.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class DynamicImport extends React.Component<IDynamicImport> {
1818
super(props);
1919
this.routeFocusTimer = 0;
2020
}
21-
public componentWillUnmount() {
21+
public componentWillUnmount(): void {
2222
window.clearTimeout(this.routeFocusTimer);
2323
}
24-
public componentDidMount() {
24+
public componentDidMount(): void {
2525
this.props
2626
.load()
2727
.then((component) => {
@@ -37,7 +37,7 @@ class DynamicImport extends React.Component<IDynamicImport> {
3737
}
3838
});
3939
}
40-
public render() {
40+
public render(): React.ReactNode {
4141
return this.props.children(this.state.component);
4242
}
4343
}

src/app/app.test.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,28 @@ describe('App tests', () => {
1515
expect(button.exists()).toBe(true);
1616
});
1717

18+
it('should hide the sidebar on smaller viewports', () => {
19+
Object.defineProperty(window, 'innerWidth', {writable: true, configurable: true, value: 600});
20+
const wrapper = mount(<App />);
21+
window.dispatchEvent(new Event('resize'));
22+
expect(wrapper.find('#page-sidebar').hasClass('pf-m-collapsed')).toBeTruthy();
23+
});
24+
25+
it('should expand the sidebar on larger viewports', () => {
26+
Object.defineProperty(window, 'innerWidth', {writable: true, configurable: true, value: 1200});
27+
const wrapper = mount(<App />);
28+
window.dispatchEvent(new Event('resize'));
29+
expect(wrapper.find('#page-sidebar').hasClass('pf-m-expanded')).toBeTruthy();
30+
});
31+
1832
it('should hide the sidebar when clicking the nav-toggle button', () => {
33+
Object.defineProperty(window, 'innerWidth', {writable: true, configurable: true, value: 1200});
1934
const wrapper = mount(<App />);
35+
window.dispatchEvent(new Event('resize'));
2036
const button = wrapper.find('#nav-toggle').hostNodes();
21-
expect(wrapper.find('#page-sidebar').hasClass('pf-m-collapsed')).toBeTruthy();
22-
button.simulate('click');
2337
expect(wrapper.find('#page-sidebar').hasClass('pf-m-expanded')).toBeTruthy();
24-
expect(wrapper.find('#page-sidebar').hasClass('pf-m-collapsed')).toBeFalsy();
38+
button.simulate('click');
39+
expect(wrapper.find('#page-sidebar').hasClass('pf-m-collapsed')).toBeTruthy();
40+
expect(wrapper.find('#page-sidebar').hasClass('pf-m-expanded')).toBeFalsy();
2541
});
2642
});

src/app/routes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ let routeFocusTimer: number;
1212

1313
const getSupportModuleAsync = () => () => import(/* webpackChunkName: 'support' */ '@app/Support/Support');
1414

15-
const Support = (routeProps: RouteComponentProps) => {
15+
const Support = (routeProps: RouteComponentProps): React.ReactElement => {
1616
const lastNavigation = useLastLocation();
1717
return (
1818
/* eslint-disable @typescript-eslint/no-explicit-any */
@@ -97,7 +97,7 @@ const PageNotFound = ({ title }: { title: string }) => {
9797
return <Route component={NotFound} />;
9898
};
9999

100-
const AppRoutes = () => (
100+
const AppRoutes = (): React.ReactElement => (
101101
<LastLocationProvider>
102102
<Switch>
103103
{routes.map(({ path, exact, component, title, isAsync }, idx) => (

0 commit comments

Comments
 (0)