Pakketkaarten: kleinere marge en kopgrootte op mobiel zodat lange titels niet overlopen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -329,6 +329,18 @@ describe('PackagesSection', () => {
|
||||
expect(screen.getByTestId('packages-status')).toHaveAttribute('aria-live', 'polite');
|
||||
});
|
||||
|
||||
it('keeps long package titles inside the card on narrow screens (smaller padding and font, wrapping allowed)', async () => {
|
||||
mockApi(packages);
|
||||
renderSection();
|
||||
await loaded();
|
||||
const card = screen.getByTestId('package-card-pakket_01');
|
||||
expect(card).toHaveClass('px-6', 'sm:px-9');
|
||||
const title = within(card).getByRole('heading', { level: 3 });
|
||||
expect(title.className).toContain('text-[clamp(24px,6.6vw,30px)]');
|
||||
expect(title.className).toContain('[overflow-wrap:anywhere]');
|
||||
expect(title).toHaveClass('hyphens-auto');
|
||||
});
|
||||
|
||||
it('gives chips a 44px touch target', async () => {
|
||||
mockApi(six);
|
||||
renderSection();
|
||||
|
||||
@@ -9,7 +9,7 @@ export function PackageCard({ pkg }: { pkg: PackageCardData }) {
|
||||
|
||||
return (
|
||||
<article
|
||||
className={`relative flex h-full flex-col px-9 pb-9 pt-10 ${
|
||||
className={`relative flex h-full flex-col px-6 pb-8 pt-9 sm:px-9 sm:pb-9 sm:pt-10 ${
|
||||
featured ? 'bg-brand text-on-brand' : 'bg-surface-2 text-text'
|
||||
}`}
|
||||
data-testid={`package-card-${pkg.id}`}
|
||||
@@ -19,7 +19,7 @@ export function PackageCard({ pkg }: { pkg: PackageCardData }) {
|
||||
Meest gekozen
|
||||
</span>
|
||||
)}
|
||||
<h3 className="mb-2.5 text-[30px] font-extrabold leading-[1.05] tracking-[-0.02em] [font-stretch:112%]">
|
||||
<h3 className="mb-2.5 hyphens-auto text-[clamp(24px,6.6vw,30px)] font-extrabold leading-[1.05] tracking-[-0.02em] [font-stretch:112%] [overflow-wrap:anywhere]">
|
||||
{pkg.title}
|
||||
</h3>
|
||||
<p className={`mb-9 text-base ${featured ? 'text-on-brand' : 'text-muted'}`}>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
export function PackageCardSkeleton() {
|
||||
return (
|
||||
<div
|
||||
className="flex h-full animate-pulse flex-col bg-surface-2 px-9 pb-9 pt-10"
|
||||
className="flex h-full animate-pulse flex-col bg-surface-2 px-6 pb-8 pt-9 sm:px-9 sm:pb-9 sm:pt-10"
|
||||
data-testid="package-card-skeleton"
|
||||
aria-hidden="true"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user