Implement stores and refills, improve testing
This commit is contained in:
parent
9f416903ef
commit
5536acd67d
137 changed files with 21218 additions and 221 deletions
24
packages/web/src/app/(dashboard)/__tests__/layout.test.tsx
Normal file
24
packages/web/src/app/(dashboard)/__tests__/layout.test.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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