2026-04-18 12:36:29 +09:00
|
|
|
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" />,
|
|
|
|
|
}));
|
|
|
|
|
|
2026-05-19 11:06:03 +09:00
|
|
|
import DashboardLayout from '../../../src/app/(dashboard)/layout';
|
2026-04-18 12:36:29 +09:00
|
|
|
|
|
|
|
|
describe('DashboardLayout', () => {
|
|
|
|
|
it('renders sidebar, topbar and children', () => {
|
2026-04-26 18:44:59 +09:00
|
|
|
render(
|
|
|
|
|
<DashboardLayout>
|
|
|
|
|
<div data-testid="child">content</div>
|
|
|
|
|
</DashboardLayout>,
|
|
|
|
|
);
|
2026-04-18 12:36:29 +09:00
|
|
|
|
|
|
|
|
expect(screen.getByTestId('sidebar')).toBeInTheDocument();
|
|
|
|
|
expect(screen.getByTestId('topbar')).toBeInTheDocument();
|
|
|
|
|
expect(screen.getByTestId('child')).toBeInTheDocument();
|
|
|
|
|
});
|
|
|
|
|
});
|