2025-09-23 22:36:40 +07:00
|
|
|
import { render, screen } from '@testing-library/react';
|
|
|
|
|
import * as alertState from 'container/CreateAlertV2/context';
|
|
|
|
|
|
|
|
|
|
import EvaluationSettings from '../EvaluationSettings';
|
|
|
|
|
import { createMockAlertContextState } from './testUtils';
|
|
|
|
|
|
2025-10-01 00:37:47 +07:00
|
|
|
jest.mock('container/CreateAlertV2/utils', () => ({
|
|
|
|
|
...jest.requireActual('container/CreateAlertV2/utils'),
|
|
|
|
|
}));
|
|
|
|
|
|
2025-09-23 22:36:40 +07:00
|
|
|
const mockSetEvaluationWindow = jest.fn();
|
|
|
|
|
jest.spyOn(alertState, 'useCreateAlertState').mockReturnValue(
|
|
|
|
|
createMockAlertContextState({
|
|
|
|
|
setEvaluationWindow: mockSetEvaluationWindow,
|
|
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
describe('EvaluationSettings', () => {
|
|
|
|
|
it('should render the condensed evaluation settings layout', () => {
|
|
|
|
|
render(<EvaluationSettings />);
|
|
|
|
|
expect(
|
|
|
|
|
screen.getByTestId('condensed-evaluation-settings-container'),
|
|
|
|
|
).toBeInTheDocument();
|
2025-10-04 23:09:18 +07:00
|
|
|
// Verify that default option is selected
|
|
|
|
|
expect(screen.getByText('Rolling')).toBeInTheDocument();
|
|
|
|
|
expect(screen.getByText('Last 5 minutes')).toBeInTheDocument();
|
2025-09-23 22:36:40 +07:00
|
|
|
});
|
|
|
|
|
});
|