diff --git a/client/src/components/Layout/Navbar.test.tsx b/client/src/components/Layout/Navbar.test.tsx index 4e8bd9af4..40ec66be4 100644 --- a/client/src/components/Layout/Navbar.test.tsx +++ b/client/src/components/Layout/Navbar.test.tsx @@ -106,6 +106,17 @@ describe('Navbar', () => { expect(backBtns.length).toBeGreaterThan(0); }); + it('FE-COMP-NAVBAR-012b: in a trip the back arrow and the trip name are one pill', async () => { + const user = userEvent.setup(); + const onBack = vi.fn(); + render(); + const pill = screen.getByRole('button', { name: 'Back: Paris 2026' }); + expect(pill).toHaveTextContent('Paris 2026'); + expect(screen.queryByRole('button', { name: 'Back' })).not.toBeInTheDocument(); + await user.click(pill); + expect(onBack).toHaveBeenCalledOnce(); + }); + it('FE-COMP-NAVBAR-013: clicking back button calls onBack', async () => { const user = userEvent.setup(); const onBack = vi.fn(); diff --git a/client/src/components/Layout/Navbar.tsx b/client/src/components/Layout/Navbar.tsx index f4f93a7f7..87f13786c 100644 --- a/client/src/components/Layout/Navbar.tsx +++ b/client/src/components/Layout/Navbar.tsx @@ -6,7 +6,7 @@ import { useSettingsStore } from '../../store/settingsStore' import { useAddonStore } from '../../store/addonStore' import { usePluginStore } from '../../store/pluginStore' import { useTranslation } from '../../i18n' -import { Plane, LogOut, Settings, ChevronDown, Shield, ArrowLeft, Users, Moon, Sun, Monitor, CalendarDays, Briefcase, Globe, Compass, BookOpen, Bookmark } from 'lucide-react' +import { Plane, LogOut, Settings, ChevronDown, Shield, ArrowLeft, ChevronLeft, Users, Moon, Sun, Monitor, CalendarDays, Briefcase, Globe, Compass, BookOpen, Bookmark } from 'lucide-react' import type { LucideIcon } from 'lucide-react' import InAppNotificationBell from './InAppNotificationBell.tsx' import HelpButton from '../Help/HelpButton' @@ -130,7 +130,7 @@ export default function Navbar({ tripTitle, tripId, onBack, showBack, onShare }: labels and then by scrolling. On a trip page there is no pill, and the trip title truncates instead. */}
- {showBack && ( + {showBack && !tripTitle && ( + ) : ( {tripTitle} - )} + ))}
{/* Centred liquid-glass tab menu (design handoff).