* update * cleanup * fixing linting and tests errors * Refactor API Parameter Handling and Update Email Transport ✅ Updated API Route Parameters: - Changed parameter type from `{ id: string }` to `Promise<{ id: string }>` in PUT and DELETE methods for better async handling. ✅ Fixed Email Transport Creation: - Updated `nodemailer.createTransporter` to `nodemailer.createTransport` for correct transport configuration. ✅ Refactored AnalyticsDashboard Component: - Changed export from default to named export for better modularity. ✅ Enhanced Email Responder Toast: - Updated toast structure to include additional properties for better user feedback. 🎯 Overall Improvements: - Improved async handling in API routes. - Ensured correct usage of nodemailer. - Enhanced component exports and user notifications.
27 lines
910 B
TypeScript
27 lines
910 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import Header from '@/app/components/Header';
|
|
import '@testing-library/jest-dom';
|
|
|
|
describe('Header', () => {
|
|
it('renders the header', () => {
|
|
render(<Header />);
|
|
expect(screen.getByText('dk')).toBeInTheDocument();
|
|
expect(screen.getByText('0')).toBeInTheDocument();
|
|
|
|
const aboutButtons = screen.getAllByText('About');
|
|
expect(aboutButtons.length).toBeGreaterThan(0);
|
|
|
|
const projectsButtons = screen.getAllByText('Projects');
|
|
expect(projectsButtons.length).toBeGreaterThan(0);
|
|
|
|
const contactButtons = screen.getAllByText('Contact');
|
|
expect(contactButtons.length).toBeGreaterThan(0);
|
|
});
|
|
|
|
it('renders the mobile header', () => {
|
|
render(<Header />);
|
|
// Check for mobile menu button (hamburger icon)
|
|
const menuButton = screen.getByRole('button');
|
|
expect(menuButton).toBeInTheDocument();
|
|
});
|
|
}); |