feat: implement logout functionality in Layout component and enhance AuthContext with auto-logout feature

This commit is contained in:
Wikid82
2025-11-19 23:26:08 -05:00
parent c97c16a752
commit 7706b01edb
4 changed files with 65 additions and 10 deletions

View File

@@ -1,10 +1,17 @@
import { ReactNode } from 'react'
import { describe, it, expect } from 'vitest'
import { describe, it, expect, vi } from 'vitest'
import { render, screen } from '@testing-library/react'
import { BrowserRouter } from 'react-router-dom'
import Layout from '../Layout'
import { ThemeProvider } from '../../context/ThemeContext'
// Mock AuthContext
vi.mock('../../context/AuthContext', () => ({
useAuth: () => ({
logout: vi.fn(),
}),
}))
const renderWithProviders = (children: ReactNode) => {
return render(
<BrowserRouter>