fix: replace revalidate with cache force-cache for SSG compatibility

This commit is contained in:
Ilia Mashkov
2026-04-23 21:45:40 +03:00
parent 5dbf5e34c2
commit f0fccd55f1
6 changed files with 154 additions and 32 deletions
@@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen } from '@testing-library/react';
import { SidebarNav } from './SidebarNav';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import type { NavItem } from '../model/types';
import { SidebarNav } from './SidebarNav';
const ITEMS: NavItem[] = [
{ id: 'bio', label: 'Bio', number: '01' },
@@ -9,13 +9,11 @@ const ITEMS: NavItem[] = [
];
beforeEach(() => {
global.IntersectionObserver = vi.fn(function () {
return {
observe: vi.fn(),
disconnect: vi.fn(),
unobserve: vi.fn(),
};
}) as unknown as typeof IntersectionObserver;
global.IntersectionObserver = class {
observe = vi.fn();
disconnect = vi.fn();
unobserve = vi.fn();
} as unknown as typeof IntersectionObserver;
});
describe('SidebarNav', () => {