mirror of
https://github.com/sstent/AICyclingCoach.git
synced 2026-03-17 10:26:47 +00:00
sync
This commit is contained in:
20
frontend/src/components/rules/__tests__/RulePreview.test.jsx
Normal file
20
frontend/src/components/rules/__tests__/RulePreview.test.jsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import RulePreview from '../RulePreview';
|
||||
|
||||
describe('RulePreview', () => {
|
||||
const mockRules = {
|
||||
maxRides: 4,
|
||||
minRestDays: 1
|
||||
};
|
||||
|
||||
test('renders preview with rules', () => {
|
||||
render(<RulePreview rules={mockRules} />);
|
||||
expect(screen.getByText('Rule Configuration Preview')).toBeInTheDocument();
|
||||
expect(screen.getByText('maxRides')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('shows placeholder when no rules', () => {
|
||||
render(<RulePreview rules={null} />);
|
||||
expect(screen.getByText('Parsed rules will appear here...')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user