import { describe, it, expect, vi } from 'vitest';
import { render, screen } from '@testing-library/react';

vi.mock('@/components/layout/Sidebar', () => ({
  Sidebar: () => <nav data-testid="sidebar" />,
}));

vi.mock('@/components/layout/TopBar', () => ({
  TopBar: () => <div data-testid="topbar" />,
}));

import DashboardLayout from '../../../src/app/(dashboard)/layout';

describe('DashboardLayout', () => {
  it('renders sidebar, topbar and children', () => {
    render(
      <DashboardLayout>
        <div data-testid="child">content</div>
      </DashboardLayout>,
    );

    expect(screen.getByTestId('sidebar')).toBeInTheDocument();
    expect(screen.getByTestId('topbar')).toBeInTheDocument();
    expect(screen.getByTestId('child')).toBeInTheDocument();
  });
});
