From 58209b2434d9331367bbb134fc36379a290e45aa Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Wed, 29 Apr 2026 18:01:14 +0700 Subject: [PATCH] fix(web): remove hardcoded mock ticker from public layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The public layout rendered its own TickerStrip with 8 hardcoded mock values ('Quận 1 +2.40%', 'Thủ Đức -0.80%', …) above the navbar. The homepage already has a live DashboardTicker driven by /price-movers, so this static one was visual noise that disagreed with the real data just below it. Drop the bar + its helper variables, and update the layout test to assert the static ticker is gone. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../[locale]/(public)/__tests__/layout.spec.tsx | 15 ++++----------- apps/web/app/[locale]/(public)/layout.tsx | 17 ----------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/apps/web/app/[locale]/(public)/__tests__/layout.spec.tsx b/apps/web/app/[locale]/(public)/__tests__/layout.spec.tsx index f79a6a7..79fb882 100644 --- a/apps/web/app/[locale]/(public)/__tests__/layout.spec.tsx +++ b/apps/web/app/[locale]/(public)/__tests__/layout.spec.tsx @@ -123,13 +123,15 @@ describe('PublicLayout', () => { expect(screen.getByTestId('navbar')).toBeInTheDocument(); }); - it('renders the ticker strip', () => { + it('does not render a static ticker strip in the layout', () => { + // The layout-level mock ticker was removed in favour of the homepage's + // live DashboardTicker driven by /price-movers. render(
Content
, ); - expect(screen.getByTestId('ticker-strip')).toBeInTheDocument(); + expect(screen.queryByTestId('ticker-strip')).not.toBeInTheDocument(); }); it('renders the footer', () => { @@ -150,15 +152,6 @@ describe('PublicLayout', () => { expect(screen.getByTestId('compare-bar')).toBeInTheDocument(); }); - it('ticker strip has 8 district items', () => { - render( - -
Content
-
, - ); - expect(screen.getByText('8 items')).toBeInTheDocument(); - }); - it('main content has id="main-content" for skip-nav', () => { const { container } = render( diff --git a/apps/web/app/[locale]/(public)/layout.tsx b/apps/web/app/[locale]/(public)/layout.tsx index 55109b2..d10f313 100644 --- a/apps/web/app/[locale]/(public)/layout.tsx +++ b/apps/web/app/[locale]/(public)/layout.tsx @@ -5,7 +5,6 @@ import { useTranslations } from 'next-intl'; import { CompareFloatingBar } from '@/components/comparison/compare-floating-bar'; import { Footer } from '@/components/design-system/footer'; import { Navbar } from '@/components/design-system/navbar'; -import { TickerStrip, type TickerItem } from '@/components/design-system/ticker-strip'; import { NotificationBell } from '@/components/notifications/notification-bell'; import { useTheme } from '@/components/providers/theme-provider'; import { LanguageSwitcher } from '@/components/ui/language-switcher'; @@ -78,17 +77,6 @@ export default function PublicLayout({ children }: { children: React.ReactNode } }, ]; - const tickerItems: TickerItem[] = [ - { id: 'q1', label: 'Quận 1', changePercent: 2.4, direction: 'up' }, - { id: 'q2', label: 'Thành phố Thủ Đức', changePercent: -0.8, direction: 'down' }, - { id: 'q3', label: 'Quận 3', changePercent: 1.1, direction: 'up' }, - { id: 'q7', label: 'Quận 7', changePercent: 3.2, direction: 'up' }, - { id: 'binhthanh', label: 'Bình Thạnh', changePercent: 0.0, direction: 'neutral' }, - { id: 'thuduc', label: 'Thành phố Thủ Đức', changePercent: 1.7, direction: 'up' }, - { id: 'tanbinhdistrict', label: 'Tân Bình', changePercent: -1.3, direction: 'down' }, - { id: 'phuninh', label: 'Phú Nhuận', changePercent: 0.5, direction: 'up' }, - ]; - const footerLinkGroups = [ { title: t('footer.propertyTypes'), @@ -120,11 +108,6 @@ export default function PublicLayout({ children }: { children: React.ReactNode } return (
- {/* Ticker strip */} -
- -
-