mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
fix(#76): keep embedded Preview from stacking freshness notices
Weekend shell already discloses context availability; a second Preview banner from shared championship headers produced conflicting Partial/Stale vocabulary. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -455,7 +455,8 @@ export function RacePreviewPage({
|
||||
data-meeting-key={previewMeeting.meeting_key}
|
||||
data-embedded={embedded ? 'true' : undefined}
|
||||
>
|
||||
{dataNotice && (
|
||||
{/* Weekend shell owns availability disclosure when Preview is embedded. */}
|
||||
{!embedded && dataNotice && (
|
||||
<DataNotice
|
||||
availability={dataNotice}
|
||||
message={noticeMessage(dataNotice)}
|
||||
|
||||
@@ -298,6 +298,8 @@ describe('RacePreviewPage', () => {
|
||||
expect(mockFetchMeetings).not.toHaveBeenCalledWith(2099, expect.anything(), expect.anything())
|
||||
expect(mockFetchSessions).toHaveBeenCalledWith(100, 'auto', expect.anything())
|
||||
expect(screen.queryByTestId('preview-header')).not.toBeInTheDocument()
|
||||
// Weekend shell owns availability disclosure — no stacked Preview notice.
|
||||
expect(screen.queryByTestId('preview-data-notice')).not.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('sanitizes raw HTTP errors and offers a guarded keyboard Retry', async () => {
|
||||
|
||||
@@ -404,6 +404,9 @@ describe('WeekendPage canonical contract rendering', () => {
|
||||
await waitFor(() => expect(screen.getByTestId('preview-page')).toBeInTheDocument())
|
||||
expect(screen.getByTestId('preview-page')).toHaveAttribute('data-meeting-key', '2')
|
||||
expect(screen.getByTestId('preview-page')).toHaveAttribute('data-embedded', 'true')
|
||||
// Single shell notice — Preview must not stack a second freshness banner.
|
||||
expect(screen.getByTestId('weekend-data-notice')).toHaveTextContent(/Partial/i)
|
||||
expect(screen.queryByTestId('preview-data-notice')).not.toBeInTheDocument()
|
||||
// Canonical identity was passed — Preview must not fan out to seasons /
|
||||
// current-season meetings selection. Prior-year lookup for "Last year here"
|
||||
// remains an intentional supplement.
|
||||
|
||||
Reference in New Issue
Block a user