Moves the app to TanStack Start with prerendering
Every page is now built as HTML from sitePages.ts, with a catch-all route for 404.html. Hooks that read the browser during render are safe for prerendering. The script step that keeps the CSP intact follows, so this build still has inline scripts and is not deployable yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -40,12 +40,16 @@ describe('DeferredImage', () => {
|
||||
});
|
||||
|
||||
it('waits for the page load event, even when already in view', async () => {
|
||||
vi.spyOn(document, 'readyState', 'get').mockReturnValue('interactive');
|
||||
const readyState = vi
|
||||
.spyOn(document, 'readyState', 'get')
|
||||
.mockReturnValue('interactive');
|
||||
await renderWithProviders(<DeferredImage image={image} />);
|
||||
const img = screen.getByRole('img', { name: 'Een foto' });
|
||||
expect(img).not.toHaveAttribute('src');
|
||||
|
||||
act(() => {
|
||||
// The browser is 'complete' by the time the load event fires
|
||||
readyState.mockReturnValue('complete');
|
||||
window.dispatchEvent(new Event('load'));
|
||||
});
|
||||
expect(img).toHaveAttribute('src', '/foto.jpg');
|
||||
|
||||
Reference in New Issue
Block a user