Adds the Lieve woorden section to the homepage
Shows client reviews one at a time with the framed photo, a large quotation mark, the shoot type and the names. Uses Chakra's carousel for paging, looping and swiping with our own controls, so visitors who prefer reduced motion get instant changes, and loads the carousel only when the section comes near the screen so the hero does not wait for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+14
-1
@@ -5,9 +5,10 @@ import {
|
||||
RouterProvider,
|
||||
} from '@tanstack/react-router';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import lighthouseConfig from '../lighthouserc.cjs';
|
||||
import ErrorPage from './components/StatusPage/ErrorPage';
|
||||
import { FakeIntersectionObserver } from './test/fakeIntersectionObserver';
|
||||
import { routeTree } from './routeTree.gen';
|
||||
import sitePages from './sitePages';
|
||||
import { axeResults } from './test/axe';
|
||||
@@ -28,8 +29,19 @@ vi.mock('./components/PageIntro/PageIntro', async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
|
||||
// The homepage's review carousel (Zag) needs an IntersectionObserver and
|
||||
// Element.scrollTo, which jsdom lacks
|
||||
beforeEach(() => {
|
||||
vi.stubGlobal('IntersectionObserver', FakeIntersectionObserver);
|
||||
Element.prototype.scrollTo = () => {};
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
crash.enabled = false;
|
||||
vi.unstubAllGlobals();
|
||||
FakeIntersectionObserver.reset();
|
||||
// @ts-expect-error -- jsdom has no Element.scrollTo of its own
|
||||
delete Element.prototype.scrollTo;
|
||||
});
|
||||
|
||||
// De echte app: route tree, router-opties en thema zoals in main.tsx
|
||||
@@ -133,6 +145,7 @@ describe('homepage', () => {
|
||||
name: 'Lifestyle fotograaf met een passie voor storytelling',
|
||||
}),
|
||||
screen.getByRole('region', { name: 'Prijzen' }),
|
||||
screen.getByRole('region', { name: 'Lieve woorden' }),
|
||||
];
|
||||
|
||||
let previous: Element = hero;
|
||||
|
||||
Reference in New Issue
Block a user