fix: full translation parity, component consistency, and link clickability
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 24s
Build & Deploy / 🧪 QA (push) Successful in 1m47s
Build & Deploy / 🏗️ Build (push) Successful in 2m46s
Build & Deploy / 🚀 Deploy (push) Successful in 25s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 44s
Build & Deploy / 🔔 Notify (push) Successful in 1s

This commit is contained in:
2026-05-27 12:04:51 +02:00
parent fa747763b8
commit 2b79d18a93
9 changed files with 199 additions and 113 deletions

View File

@@ -2,6 +2,7 @@ import * as React from 'react';
import { describe, it, expect, vi } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/react';
import { ReferencesSlider, Reference } from './ReferencesSlider';
import { NextIntlClientProvider } from 'next-intl';
// Mock next/link to render standard <a> tag
vi.mock('next/link', () => ({
@@ -21,6 +22,13 @@ vi.mock('next/image', () => ({
}
}));
// Mock next-intl
vi.mock('next-intl', () => ({
useTranslations: () => (key: string) => key,
useLocale: () => 'en',
NextIntlClientProvider: ({ children }: any) => <>{children}</>
}));
describe('ReferencesSlider TDD', () => {
const mockReferences: Reference[] = [
{
@@ -49,8 +57,8 @@ describe('ReferencesSlider TDD', () => {
const links = screen.getAllByTestId('reference-tile-link');
expect(links).toHaveLength(2);
expect(links[0].getAttribute('href')).toBe('/referenzen/referenz-projekt-eins');
expect(links[1].getAttribute('href')).toBe('/referenzen/referenz-projekt-zwei');
expect(links[0].getAttribute('href')).toBe('/en/referenzen/referenz-projekt-eins');
expect(links[1].getAttribute('href')).toBe('/en/referenzen/referenz-projekt-zwei');
});
it('allows navigation on simple click (no drag)', () => {