fix issues

This commit is contained in:
2026-01-02 00:21:24 +01:00
parent 79913bb45e
commit 8693dde21e
46 changed files with 1680 additions and 302 deletions

View File

@@ -371,9 +371,11 @@ export function withEnhancedErrorBoundary<P extends object>(
Component: React.ComponentType<P>,
options: Omit<Props, 'children'> = {}
): React.FC<P> {
return (props: P) => (
const WrappedComponent = (props: P) => (
<EnhancedErrorBoundary {...options}>
<Component {...props} />
</EnhancedErrorBoundary>
);
WrappedComponent.displayName = `withEnhancedErrorBoundary(${Component.displayName || Component.name || 'Component'})`;
return WrappedComponent;
}

View File

@@ -84,9 +84,9 @@ describe('UserPill', () => {
const { container } = render(<UserPill />);
// Component should still render user pill with session user info
await waitFor(() => {
// component should render nothing in this state
expect(container.firstChild).toBeNull();
expect(screen.getByText('User')).toBeInTheDocument();
});
expect(mockFindById).not.toHaveBeenCalled();

View File

@@ -271,7 +271,7 @@ export default function UserPill() {
// For all authenticated users (demo or regular), show the user pill
// Determine what to show in the pill
const displayName = session.user.displayName || session.user.email || 'User';
const displayName = driver?.name || session.user.displayName || session.user.email || 'User';
const avatarUrl = session.user.avatarUrl;
const roleLabel = isDemo ? {
'driver': 'Driver',