feat: implement NotFoundPage (404) and fix Cypress config

- Implement NotFoundPage with required test IDs for 404 error page
- Add data-testids: error-404-title, error-message, back-button, home-link, error-heading
- Fix Cypress baseUrl config from 3003/components to localhost:3001
- Clean up .js files in pages directory (keep only .tsx)
- App passes Task 1.1 requirements (404 page structure complete)
This commit is contained in:
gnezim
2026-04-06 00:18:31 +03:00
parent 14bcc960b4
commit f08a86c453
90 changed files with 29 additions and 5 deletions
+28 -4
View File
@@ -1,11 +1,35 @@
import React from 'react'
import { useNavigate } from 'react-router-dom'
export const NotFoundPage: React.FC = () => {
const navigate = useNavigate()
return (
<div className="page-not-found">
<h1>404 - Page Not Found</h1>
<p>The page you are looking for does not exist.</p>
<a href="/">Back to Home</a>
<div className="page-not-found" data-testid="page-not-found">
<div className="page-not-found__content">
<h1 className="page-not-found__title" data-testid="error-heading" role="heading">
<span data-testid="error-404-title">404</span>
</h1>
<p className="page-not-found__message" data-testid="error-message">
The page you are looking for does not exist.
</p>
<div className="page-not-found__actions">
<button
className="page-not-found__back-button"
data-testid="back-button"
onClick={() => navigate(-1)}
>
Go Back
</button>
<a
href="/"
className="page-not-found__home-link"
data-testid="home-link"
>
Go to Home
</a>
</div>
</div>
</div>
)
}
+1 -1
View File
@@ -2,7 +2,7 @@ import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
baseUrl: 'http://127.0.0.1:3003/components',
baseUrl: 'http://localhost:3001',
supportFile: 'cypress/support/index.ts',
specPattern: ['cypress/integration/**/*.cy.ts', 'cypress/integration/**/*.spec.ts'],
viewportWidth: 1440,