From e14f118f35d1fa17e17e7778edecf6227ae776db Mon Sep 17 00:00:00 2001 From: MoonTestUse1 Date: Tue, 7 Jan 2025 06:58:25 +0600 Subject: [PATCH] Fix database --- .gitlab-ci.yml | 5 +---- frontend/package.json | 17 ++++++++++------- frontend/public/index.html | 14 ++++++++++++++ frontend/src/App.js | 13 +++++++++++++ frontend/src/App.test.js | 5 ++++- frontend/src/index.js | 10 ++++++++++ 6 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 frontend/public/index.html create mode 100644 frontend/src/App.js create mode 100644 frontend/src/index.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4853a0f..3017fde 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,12 +34,9 @@ test-frontend: cache: paths: - frontend/node_modules/ - key: - files: - - frontend/package-lock.json before_script: - cd frontend - - npm ci + - npm install script: - npm run test rules: diff --git a/frontend/package.json b/frontend/package.json index 5ba81bd..4250351 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -2,28 +2,31 @@ "name": "employee-request-system-frontend", "version": "1.0.0", "description": "Frontend for Employee Request System", + "private": true, "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "test": "echo \"No tests yet - this is a placeholder for future tests\" && exit 0", + "test": "react-scripts test --watchAll=false --passWithNoTests", "eject": "react-scripts eject" }, "dependencies": { - "@emotion/react": "^11.11.3", - "@emotion/styled": "^11.11.0", - "@mui/material": "^5.15.3", - "@mui/icons-material": "^5.15.3", - "axios": "^1.6.5", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.21.1", - "react-scripts": "5.0.1" + "react-scripts": "5.0.1", + "axios": "^1.6.5" }, "devDependencies": { "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0" }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, "browserslist": { "production": [ ">0.2%", diff --git a/frontend/public/index.html b/frontend/public/index.html new file mode 100644 index 0000000..1bf9535 --- /dev/null +++ b/frontend/public/index.html @@ -0,0 +1,14 @@ + + + + + + + + Employee Request System + + + +
+ + \ No newline at end of file diff --git a/frontend/src/App.js b/frontend/src/App.js new file mode 100644 index 0000000..c387c70 --- /dev/null +++ b/frontend/src/App.js @@ -0,0 +1,13 @@ +import React from 'react'; + +function App() { + return ( +
+
+

Employee Request System

+
+
+ ); +} + +export default App; \ No newline at end of file diff --git a/frontend/src/App.test.js b/frontend/src/App.test.js index e3bc97b..99e907e 100644 --- a/frontend/src/App.test.js +++ b/frontend/src/App.test.js @@ -1,6 +1,9 @@ import { render, screen } from '@testing-library/react'; +import '@testing-library/jest-dom'; import App from './App'; -test('renders without crashing', () => { +test('renders app header', () => { render(); + const headerElement = screen.getByText(/Employee Request System/i); + expect(headerElement).toBeInTheDocument(); }); \ No newline at end of file diff --git a/frontend/src/index.js b/frontend/src/index.js new file mode 100644 index 0000000..7a40b29 --- /dev/null +++ b/frontend/src/index.js @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; + +const root = ReactDOM.createRoot(document.getElementById('root')); +root.render( + + + +); \ No newline at end of file