import { describe, expect, it, vi } from 'vitest';
import { homepageContent } from '$lib/content/homepage';

const { getHomepageContent } = vi.hoisted(() => ({
  getHomepageContent: vi.fn()
}));

vi.mock('$lib/server/content', () => ({
  getHomepageContent
}));

import { load } from './+page.server';

describe('home page server load', () => {
  it('returns homepage content', async () => {
    getHomepageContent.mockResolvedValue(homepageContent);

    await expect(load()).resolves.toEqual({
      content: homepageContent
    });
  });
});
