From c71db17200b52e79d3be636421e9d78565d16529 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 4 Jul 2022 15:59:11 +0200 Subject: [PATCH] Fixed tests --- apps/comments-ui/package.json | 2 +- apps/comments-ui/src/App.js | 10 +++++----- apps/comments-ui/src/App.test.js | 6 +++--- apps/comments-ui/src/reportWebVitals.js | 13 ------------- 4 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 apps/comments-ui/src/reportWebVitals.js diff --git a/apps/comments-ui/package.json b/apps/comments-ui/package.json index 00db19e9ac..944e055439 100644 --- a/apps/comments-ui/package.json +++ b/apps/comments-ui/package.json @@ -22,7 +22,7 @@ "build:combined": "node ./scripts/build-combined.js", "build:bundle": "webpack --config webpack.config.js", "test:ui": "react-scripts test", - "test": "yarn test --watchAll=false --coverage", + "test": "yarn test:ui --watchAll=false --coverage", "eject": "react-scripts eject", "lint": "eslint src --ext .js --cache", "preship": "yarn lint", diff --git a/apps/comments-ui/src/App.js b/apps/comments-ui/src/App.js index fa26bfd1df..ddc793ba85 100644 --- a/apps/comments-ui/src/App.js +++ b/apps/comments-ui/src/App.js @@ -1,11 +1,11 @@ import './App.css'; function App() { - return ( -
- Hello world -
- ); + return ( +
+ Hello world +
+ ); } export default App; diff --git a/apps/comments-ui/src/App.test.js b/apps/comments-ui/src/App.test.js index 1f03afeece..0f2f0d6016 100644 --- a/apps/comments-ui/src/App.test.js +++ b/apps/comments-ui/src/App.test.js @@ -2,7 +2,7 @@ import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { - render(); - const linkElement = screen.getByText(/learn react/i); - expect(linkElement).toBeInTheDocument(); + render(); + const linkElement = screen.getByText(/hello world/i); + expect(linkElement).toBeInTheDocument(); }); diff --git a/apps/comments-ui/src/reportWebVitals.js b/apps/comments-ui/src/reportWebVitals.js deleted file mode 100644 index 5253d3ad9e..0000000000 --- a/apps/comments-ui/src/reportWebVitals.js +++ /dev/null @@ -1,13 +0,0 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals;