feat: add admin-web Docker build & push workflow with semantic-release #11
@@ -91,8 +91,10 @@ describe('Sidebar', () => {
|
||||
})
|
||||
|
||||
it('should handle logout errors gracefully', async () => {
|
||||
mockSignOut.mockRejectedValueOnce(new Error('Network error'))
|
||||
|
||||
// Real supabase.auth.signOut() never throws — it resolves with { error }.
|
||||
// Mocking it realistically avoids an unhandled rejection and matches prod behaviour.
|
||||
mockSignOut.mockResolvedValueOnce({ error: new Error('Network error') })
|
||||
|
||||
render(<Sidebar />)
|
||||
|
||||
const logoutButton = screen.getByRole('button', { name: /logout/i })
|
||||
@@ -101,6 +103,9 @@ describe('Sidebar', () => {
|
||||
await waitFor(() => {
|
||||
expect(mockSignOut).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
// Graceful: even when signOut errors, the user is still redirected to login.
|
||||
expect(mockPush).toHaveBeenCalledWith('/login')
|
||||
})
|
||||
|
||||
it('should have correct styling for navigation', () => {
|
||||
|
||||
Reference in New Issue
Block a user