Adds the Lifestyle fotografie section to the homepage
Adds the first block below the hero: heading, intro and a staggered gallery of four live photos. Brings in the shared section building blocks (HomeSection, SectionHeading, Reveal) and DeferredImage, which holds back below-the-fold photos until the page has loaded so they do not compete with the hero for bandwidth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { act, renderHook } from '@testing-library/react';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import usePageLoaded from './usePageLoaded';
|
||||
|
||||
describe('usePageLoaded', () => {
|
||||
it('is true when the page had already loaded', () => {
|
||||
const { result } = renderHook(() => usePageLoaded());
|
||||
expect(result.current).toBe(true);
|
||||
});
|
||||
|
||||
it('turns true on the load event', () => {
|
||||
vi.spyOn(document, 'readyState', 'get').mockReturnValue('interactive');
|
||||
const { result } = renderHook(() => usePageLoaded());
|
||||
expect(result.current).toBe(false);
|
||||
|
||||
act(() => {
|
||||
window.dispatchEvent(new Event('load'));
|
||||
});
|
||||
expect(result.current).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user