Skip to content

More test #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 18, 2025
Merged

More test #12

merged 17 commits into from
Mar 18, 2025

Conversation

shahariaazam
Copy link
Member

This pull request includes significant refactoring and restructuring of the component files and their corresponding tests. The main changes involve renaming files and updating import paths to reflect the new directory structure. Additionally, there are new test implementations and mock setups for various components.

Refactoring and File Restructuring:

New Test Implementations:

Mock Setups:

Additional Changes:

Introduce comprehensive tests for ToolsToggle to validate rendering, state changes, and user interactions. Also remove an unnecessary comment in ToolsModal.tsx for clarity."
Introduce comprehensive tests for the ToolsModal component, including rendering, tool fetching, filtering, selection/deselection, and close behavior. Mocks were added for dependent components and modules to isolate the functionality of ToolsModal. These tests ensure reliable operation and regression prevention.
Updated the import path to correctly reference the ToolsToggle component. This ensures the test imports the component from the correct directory, aligning with the file structure.
Updated the import path for the ToolsModal mock in the test file to reflect the correct relative location. This ensures the test references the intended module and eliminates potential errors.
Updated relative import paths in test files to ensure consistency and proper module resolution. This improves maintainability and aligns with the project's directory structure.
Moved WelcomeScreen to a dedicated folder for better structure. Added comprehensive tests for the ToolItem component to ensure its behavior and accessibility work as expected. Improved overall code organization and test coverage.
Reorganized the ToolItem component into its own dedicated folder (`ToolItem/ToolItem.tsx`) for better modularity and clarity. Updated all related imports and mocks to reflect the new directory structure. There are no functional changes in this update.
Standardize component file organization by moving files into dedicated subdirectories. Adjusted imports across the project to reflect the new structure, ensuring better maintainability and clarity in the codebase.
Moved NotificationContainer and NotificationToast to a dedicated 'Notification' directory. Updated import paths to reflect the new structure, improving organization and maintainability of components."
Extract NotificationContext type into its own file and reorganize related logic. Split `useNotification` into a dedicated module and update imports across components for better modularity and maintainability.
Adjusted the import path for the Notification type to reflect the correct relative location. This fixes potential import resolution issues caused by the incorrect path.
Updated service constructors to accept optional base URLs, enhancing flexibility for API endpoints. Added unit tests for ChatContainer to ensure functionality and error handling, and improved LLMProviderToggle with better test coverage by adding a data-testid attribute.
Introduced streaming response handling in ChatContainer with chunked updates and configurable stream settings. Added quick access tool toggles in ChatInput using new `toolIcons` mappings. Refined Tool and API integrations to support dynamic tool loading.
Revised the tests to check the button's `title` attribute instead of its text content. This ensures consistency with the updated UI behavior while maintaining accurate assertions for accessibility and functionality.
Added mocks for MessageContent, Message, ToolService, and ChatInput to isolate tests and avoid dependency-related errors. Updated test cases to ensure proper authentication handling and validate interactions with mocked services. These changes enhance test reliability and maintainability.
Encapsulated notification logic into a local function to enhance code readability and maintainability. This eliminates duplication and promotes reuse within the error handling flow.
@shahariaazam shahariaazam merged commit 8c430ad into main Mar 18, 2025
2 of 3 checks passed
@shahariaazam shahariaazam deleted the more-test branch March 18, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant