Add test component; Run prettier

This commit is contained in:
Manuel Prodinger
2022-03-23 10:50:48 +01:00
parent 78a505eb44
commit aa9c894de1
7 changed files with 25 additions and 23 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {},
}, },
} };
+4 -7
View File
@@ -1,4 +1,5 @@
import logo from './logo.svg'; import logo from "./logo.svg";
import Test from "./Components/test";
function App() { function App() {
return ( return (
@@ -7,13 +8,9 @@ function App() {
<img src={logo} className="App-logo" alt="logo" /> <img src={logo} className="App-logo" alt="logo" />
<p className="underline hover:text-blue-500"> <p className="underline hover:text-blue-500">
Edit <code>src/App.js</code> and save to reload. Edit <code>src/App.js</code> and save to reload.
<Test />
</p> </p>
<a <a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React Learn React
</a> </a>
</header> </header>
+3 -3
View File
@@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react'; import { render, screen } from "@testing-library/react";
import App from './App'; import App from "./App";
test('renders learn react link', () => { test("renders learn react link", () => {
render(<App />); render(<App />);
const linkElement = screen.getByText(/learn react/i); const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument(); expect(linkElement).toBeInTheDocument();
+7
View File
@@ -0,0 +1,7 @@
import React from "react";
function test() {
return <p className="bg-green-800 rounded-lg"> test </p>;
}
export default test;
+6 -6
View File
@@ -1,14 +1,14 @@
import React from 'react'; import React from "react";
import ReactDOM from 'react-dom'; import ReactDOM from "react-dom";
import './index.css'; import "./index.css";
import App from './App'; import App from "./App";
import reportWebVitals from './reportWebVitals'; import reportWebVitals from "./reportWebVitals";
ReactDOM.render( ReactDOM.render(
<React.StrictMode> <React.StrictMode>
<App /> <App />
</React.StrictMode>, </React.StrictMode>,
document.getElementById('root') document.getElementById("root")
); );
// If you want to start measuring performance in your app, pass a function // If you want to start measuring performance in your app, pass a function
+2 -2
View File
@@ -1,6 +1,6 @@
const reportWebVitals = onPerfEntry => { const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) { if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry); getCLS(onPerfEntry);
getFID(onPerfEntry); getFID(onPerfEntry);
getFCP(onPerfEntry); getFCP(onPerfEntry);
+2 -4
View File
@@ -1,9 +1,7 @@
module.exports = { module.exports = {
content: [ content: ["./src/**/*.{js,jsx,ts,tsx}"],
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: { theme: {
extend: {}, extend: {},
}, },
plugins: [], plugins: [],
} };