diff --git a/jam-ui/src/components/client/__tests__/JKSessionSettingsModal.test.js b/jam-ui/src/components/client/__tests__/JKSessionSettingsModal.test.js new file mode 100644 index 000000000..9ef79b770 --- /dev/null +++ b/jam-ui/src/components/client/__tests__/JKSessionSettingsModal.test.js @@ -0,0 +1,41 @@ +import React from 'react'; +import { render, screen, fireEvent } from '@testing-library/react'; +import JKSessionSettingsModal from '../JKSessionSettingsModal'; +import { SESSION_PRIVACY_MAP } from '../../../helpers/globals.js'; + +// Mock react-i18next (required because component uses useTranslation) +jest.mock('react-i18next', () => ({ + useTranslation: () => ({ + t: (key) => { + const translations = { + 'new.privacy_opt_public': 'Public', + 'new.privacy_opt_private_invite': 'Private (Invite Only)', + 'new.privacy_opt_private_approve': 'Private (Approval Required)' + }; + return translations[key] || key; + } + }) +})); + +// Helper function for rendering component with default props +const renderModal = (props = {}) => { + const defaultProps = { + isOpen: true, + toggle: jest.fn(), + currentSession: { + privacy: SESSION_PRIVACY_MAP.private_approve, + description: 'Test session description' + }, + onSave: jest.fn(), + loading: false + }; + return render(); +}; + +describe('JKSessionSettingsModal', () => { + // Placeholder test to verify setup + test('renders without crashing', () => { + renderModal(); + expect(screen.getByText('Session Settings')).toBeInTheDocument(); + }); +});