""" Unit Tests for Meetings Frontend Module Tests for the refactored meetings frontend components: - meetings_styles.py (CSS and Icons) - meetings_templates.py (Sidebar and Base-Page Templates) - meetings.py (Route handlers) """ import pytest from unittest.mock import patch, MagicMock from fastapi.testclient import TestClient from fastapi import FastAPI import sys sys.path.insert(0, '..') from frontend.meetings_styles import BREAKPILOT_STYLES, ICONS from frontend.meetings_templates import render_sidebar, render_base_page from frontend.meetings import router # Create test app app = FastAPI() app.include_router(router) client = TestClient(app) class TestMeetingsStyles: """Test CSS styles and icons""" def test_breakpilot_styles_exists(self): """Test that BREAKPILOT_STYLES is defined""" assert BREAKPILOT_STYLES is not None assert isinstance(BREAKPILOT_STYLES, str) assert len(BREAKPILOT_STYLES) > 0 def test_breakpilot_styles_contains_css_variables(self): """Test that CSS contains required variables""" assert "--bp-primary:" in BREAKPILOT_STYLES assert "--bp-bg:" in BREAKPILOT_STYLES assert "--bp-surface:" in BREAKPILOT_STYLES assert "--bp-text:" in BREAKPILOT_STYLES def test_breakpilot_styles_contains_layout_classes(self): """Test that CSS contains layout classes""" assert ".app-container" in BREAKPILOT_STYLES assert ".sidebar" in BREAKPILOT_STYLES assert ".main-content" in BREAKPILOT_STYLES def test_icons_exists(self): """Test that ICONS dictionary is defined""" assert ICONS is not None assert isinstance(ICONS, dict) def test_icons_contains_required_icons(self): """Test that required icons are present""" required_icons = ['home', 'video', 'calendar', 'graduation', 'record', 'grid', 'external', 'users', 'plus'] for icon in required_icons: assert icon in ICONS, f"Missing icon: {icon}" def test_icons_are_svg(self): """Test that icons are SVG strings""" for name, svg in ICONS.items(): assert isinstance(svg, str), f"Icon {name} is not a string" assert "Test Content

") assert isinstance(result, str) assert "" in result assert "" in result def test_render_base_page_contains_title(self): """Test that title is included in HTML""" result = render_base_page("My Test Page", "

Content

") assert "My Test Page" in result assert "BreakPilot Meet – My Test Page" in result def test_render_base_page_contains_content(self): """Test that content is included in HTML""" test_content = "

This is test content

" result = render_base_page("Title", test_content) assert test_content in result def test_render_base_page_includes_styles(self): """Test that styles are included""" result = render_base_page("Title", "Content") assert "