Skip to content

Commit

Permalink
Tweaks to the Dashboard to make it pass lint/unit-tests.
Browse files Browse the repository at this point in the history
(Hopefully, these will be merged from other PRs.)
  • Loading branch information
webbnh committed Jul 21, 2022
1 parent 50f4296 commit 5e19f45
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 9 additions & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"eject": "react-scripts eject",
"server": "node server",
"start": "react-app-rewired start",
"test": "react-app-rewired test"
"test": "react-scripts test"
},
"proxy": "http://localhost:3001",
"eslintConfig": {
Expand All @@ -56,6 +56,14 @@
"react-app/jest"
]
},
"jest": {
"transform": {
"^.+\\.[t|j]sx?$": "babel-jest"
},
"transformIgnorePatterns": [
"node_modules/(?!@patternfly)/"
]
},
"browserslist": {
"production": [
">0.2%",
Expand Down
15 changes: 13 additions & 2 deletions dashboard/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import { render, screen } from '@testing-library/react';
import App from './App';
import { Provider } from "react-redux";
import store from "store/store";
import React from 'react';

const AppWrapper = () => {
return (
<Provider store={store}>
<App />
</Provider>
);
};

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
render(<AppWrapper />);
const linkElement = screen.getByText('Explore');
expect(linkElement).toBeInTheDocument();
});

0 comments on commit 5e19f45

Please sign in to comment.