Files
spliit/src/app/groups/[groupId]/group-header.tsx
Sebastien Castiel 5e81dd9deb Add test ID to group header for E2E test reliability
Update group header component to include data-testid for improved test targeting
and update Page Object Model to use the more reliable test ID selector.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 21:05:27 -04:00

33 lines
949 B
TypeScript

'use client'
import { GroupTabs } from '@/app/groups/[groupId]/group-tabs'
import { ShareButton } from '@/app/groups/[groupId]/share-button'
import { Skeleton } from '@/components/ui/skeleton'
import Link from 'next/link'
import { useCurrentGroup } from './current-group-context'
export const GroupHeader = () => {
const { isLoading, groupId, group } = useCurrentGroup()
return (
<div className="flex flex-col justify-between gap-3">
<h1 className="font-bold text-2xl">
<Link href={`/groups/${groupId}`}>
{isLoading ? (
<Skeleton className="mt-1.5 mb-1.5 h-5 w-32" />
) : (
<div className="flex" data-testid="group-name">
{group.name}
</div>
)}
</Link>
</h1>
<div className="flex gap-2 justify-between">
<GroupTabs groupId={groupId} />
{group && <ShareButton group={group} />}
</div>
</div>
)
}