From efb8db8db347ba852c2997e0754354886988eec9 Mon Sep 17 00:00:00 2001 From: CodingOnStar Date: Thu, 27 Aug 2026 16:22:45 +0800 Subject: [PATCH] fix(web): keep creator profile background continuous (ECO-468) --- .../__tests__/view-layout.browser.spec.tsx | 64 +++++++++++++++++++ .../marketplace/creator-profile/view.tsx | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 web/app/components/plugins/marketplace/creator-profile/__tests__/view-layout.browser.spec.tsx diff --git a/web/app/components/plugins/marketplace/creator-profile/__tests__/view-layout.browser.spec.tsx b/web/app/components/plugins/marketplace/creator-profile/__tests__/view-layout.browser.spec.tsx new file mode 100644 index 00000000000..ae7959e16aa --- /dev/null +++ b/web/app/components/plugins/marketplace/creator-profile/__tests__/view-layout.browser.spec.tsx @@ -0,0 +1,64 @@ +import type { CreatorProfileViewModel } from '../model' +import { render } from 'vitest-browser-react' +import CreatorProfileView from '../view' + +vi.mock('#i18n', async () => { + const { withSelectorKey } = await import('@/test/i18n-mock') + + return { + useTranslation: () => ({ + t: withSelectorKey((key: string) => key), + }), + } +}) + +vi.mock('../creator-sidebar', () => ({ + default: () => , +})) + +vi.mock('../creator-content', () => ({ + default: () => ( +
+ Creator content +
+ ), +})) + +const profile: CreatorProfileViewModel = { + profile: { + kind: 'individual', + displayName: 'Creator', + handle: 'creator', + avatarUrl: '', + backgroundUrl: '', + badges: [], + socialLinks: [], + }, + creations: [], +} + +describe('CreatorProfileView layout', () => { + it('keeps the profile background behind content taller than its scrollport', async () => { + const screen = await render( +
+ ({ type: 'link', href: '/' })} + /> +
, + ) + + const scrollport = screen.getByTestId('creator-scrollport').element() + const profileRoot = scrollport.firstElementChild as HTMLElement + const creations = screen.getByTestId('creator-creations').element() + + expect(profileRoot.getBoundingClientRect().bottom).toBeGreaterThanOrEqual( + creations.getBoundingClientRect().bottom, + ) + }) +}) diff --git a/web/app/components/plugins/marketplace/creator-profile/view.tsx b/web/app/components/plugins/marketplace/creator-profile/view.tsx index a5554b2de50..ebae19c187e 100644 --- a/web/app/components/plugins/marketplace/creator-profile/view.tsx +++ b/web/app/components/plugins/marketplace/creator-profile/view.tsx @@ -27,7 +27,7 @@ export default function CreatorProfileView({ const { t } = useTranslation() return ( -
+
{header}