Tests refactor
This commit is contained in:
parent
245520fb50
commit
99134d8556
165 changed files with 911 additions and 531 deletions
|
|
@ -1,26 +0,0 @@
|
|||
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 '../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();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue