index.test.tsx
556 Bytes
import { render, screen } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { PageShell } from './index';
describe('PageShell', () => {
it('renders title and description', () => {
render(
<PageShell title="标题" description="说明">
<p>内容</p>
</PageShell>,
);
expect(screen.getByRole('heading', { level: 1, name: '标题' })).toBeInTheDocument();
expect(screen.getByText('说明')).toBeInTheDocument();
expect(screen.getByText('内容')).toBeInTheDocument();
});
});