photo visibility for demo events, hardened the demo mode. fixed dark/light mode toggle and notification bell toggle. fixed photo upload page sizes & header visibility.

This commit is contained in:
Codex Agent
2025-12-18 21:14:24 +01:00
parent 7c4067b32b
commit 53ec427e6e
25 changed files with 965 additions and 102 deletions

View File

@@ -0,0 +1,48 @@
import React from 'react';
import { describe, expect, it, vi } from 'vitest';
import { render, screen } from '@testing-library/react';
import { MemoryRouter } from 'react-router-dom';
import GalleryPreview from '../GalleryPreview';
vi.mock('../../polling/usePollGalleryDelta', () => ({
usePollGalleryDelta: () => ({
photos: [],
loading: false,
}),
}));
vi.mock('../../i18n/useTranslation', () => ({
useTranslation: () => ({
locale: 'de',
}),
}));
vi.mock('../../context/EventBrandingContext', () => ({
useEventBranding: () => ({
branding: {
primaryColor: '#f43f5e',
secondaryColor: '#fb7185',
buttons: { radius: 12, linkColor: '#fb7185' },
typography: {},
fontFamily: 'Montserrat',
},
}),
}));
describe('GalleryPreview', () => {
it('renders dark mode-ready surfaces', () => {
render(
<MemoryRouter>
<GalleryPreview token="demo" />
</MemoryRouter>,
);
const card = screen.getByTestId('gallery-preview');
expect(card.className).toContain('bg-[var(--guest-surface)]');
expect(card.className).toContain('dark:bg-slate-950/70');
const emptyState = screen.getByText(/Noch keine Fotos/i).closest('div');
expect(emptyState).not.toBeNull();
expect(emptyState?.className).toContain('dark:bg-slate-950/60');
});
});