-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
More test #12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
src/App.tsx
: Updated import paths for several components to reflect their new locations.src/components/ChatContainer/ChatContainer.tsx
: Renamed fromsrc/components/ChatContainer.tsx
and updated import paths accordingly.src/components/ChatInput/ChatInput.tsx
: Renamed fromsrc/components/ChatInput.tsx
and updated import paths accordingly.src/components/Notification/NotificationContainer.tsx
: Renamed fromsrc/components/NotificationContainer.tsx
and updated import paths accordingly.New Test Implementations:
src/components/ChatContainer/ChatContainer.test.tsx
: Added comprehensive tests forChatContainer
, including mocks for dependencies and various test cases for authentication, chat history loading, and error handling.src/components/ChatInputButton/ToolsModal.test.tsx
: Added tests forToolsModal
component, including mock setups and test cases for tool fetching, searching, selection, and modal interactions.src/components/ChatInputButton/ToolsToggle.test.tsx
: Added tests forToolsToggle
component, including mock setups and test cases for modal interactions and tool selection changes.Mock Setups:
src/components/ChatContainer/ChatContainer.test.tsx
: Implemented mocks forauth0
,ChatService
,LLMService
, and notification context to facilitate testing.src/components/ChatInputButton/ToolsModal.test.tsx
: Implemented mocks forfetchTools
,XMarkIcon
,SearchBar
, andToolItem
to facilitate testing.Additional Changes:
src/components/LLMProviderModal/LLMProviderCard.tsx
: Renamed fromsrc/components/LLMProviderCard.tsx
and updated import paths accordingly.src/components/LLMProviderModal/LLMProvidersModal.tsx
: Renamed fromsrc/components/LLMProvidersModal.tsx
and updated import paths accordingly.src/components/LLMProviderToggle/LLMProviderToggle.tsx
: Renamed fromsrc/components/LLMProviderToggle.tsx
, updated import paths, and added adata-testid
attribute for testing. [1] [2]src/components/Notification/NotificationToast.tsx
: Renamed fromsrc/components/NotificationToast.tsx
and updated import paths accordingly.