Skip to content
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

Fixfrontendtests #57

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open

Fixfrontendtests #57

wants to merge 46 commits into from

Conversation

iLevyTate
Copy link
Member

Modified frontend tests to align with current functionalities.
Removed Cypress end-to-end tests, as the focus has shifted to increasing Jest unit tests and adding integration tests for fuller coverage.
Planned transition to snapshot tests after achieving sufficient unit and integration test coverage.

iLevyTate and others added 30 commits January 2, 2025 17:06
- Created tests for the Chat API to validate request handling, including valid and invalid agent types, and missing fields.
- Added tests for the AgentResponse component to ensure correct rendering and interaction.
- Implemented tests for the ChatInterfaceClient component, covering rendering, input handling, message submission, and error states.
- Developed tests for the LoadingSpinner and MessageActions components to verify rendering and functionality.
- Added tests for the useChatScroll and useMediaQuery hooks to ensure correct behavior under various conditions.
- Introduced a new global CSS file for consistent styling across the application.
- Updated the ChatInterface component to use the new ChatInterfaceClient for improved performance.
- Added a loading state for chat interactions to enhance user experience.
- Created a dedicated error handling component for chat errors.
- Implemented a new layout for the chat page, including metadata for better SEO.
- Added a loading component for the chat interface.
- Established a new API route for handling chat requests with rate limiting and input sanitization.
- Updated the account and login pages for better user interaction and visual consistency.
- Enhanced the About and Home pages to reflect the new branding and messaging for SCANUEV.
- Introduced new Avatar, Button, ContextMenu, DropdownMenu, GlassCard, GradientButton, Input, Label, LoadingDots, Skeleton, Tooltip, and WavyBackground components.
- Each component is designed with customizable properties and styles for improved flexibility and usability.
- Implemented forward refs for better integration with parent components.
- Utilized utility functions for class name management to ensure consistent styling across components.
- Deleted several chart components (AgentBarChart, AgentForceGraph, AgentHeatmap, AgentPolarChart, AgentRadarChart, AgentResponseVisualization, and NetworkGraph) to streamline the codebase.
- Introduced new components including BotAvatar, ChatContainer, ChatMessage, LoadingSpinner, and ScrollToTop for enhanced chat functionality.
- Updated the ChatInterfaceClient to improve user experience with better message handling and loading states.
- Implemented a new error boundary component for robust error handling in the chat interface.
- Enhanced navigation and page transition animations for a smoother user experience.
- Introduced new Cypress test files for the chat interface and navigation, covering key functionalities such as message sending, agent type switching, and feedback submission.
- Implemented tests for page navigation, including checks for 404 error handling and smooth scrolling behavior.
- Added custom commands for user login in the Cypress support file.
- Included video recordings and screenshots for failed test cases to aid in debugging.
- Introduced `useChatScroll` hook to manage automatic scrolling in chat interfaces based on message updates.
- Added `useChatShortcuts` hook to handle keyboard shortcuts for search and input focus within chat.
- Created `useMediaQuery` hook to determine if a media query matches, enhancing responsive design capabilities.
- Implemented `useScrollDirection` hook to track scroll direction, aiding in UI adjustments based on user scrolling behavior.
- Added unit tests for `useMediaQuery` to ensure correct functionality under various conditions.
- Introduced `formatTime` utility function to format Date objects into a string representation of hours and minutes.
- Added new TypeScript interfaces for chat messages, loading spinner properties, and media query configurations.
- Defined custom types for agent types and media queries to enhance type safety and clarity in the codebase.
- Included type definitions for lodash debounce functionality and Radix UI components to improve integration and usability.
- Removed unused files including .gitignore, .prettierignore, and .prettierrc to streamline the project.
- Deleted the ChatInterface component and replaced it with a new structure for improved performance and user experience.
- Introduced a new components.json file for better component management and organization.
- Added Cypress configuration for end-to-end testing and established a new Jest configuration for unit testing.
- Updated Dockerfile to use a more recent Node.js version and simplified the build process.
- Created a new README.md file to provide project overview and installation instructions.
- Enhanced package.json with updated dependencies and scripts for testing and development.
- Implemented a new Tailwind CSS configuration for improved styling capabilities.
…d PageTransition components

- Updated BotAvatar component to simplify SVG structure and improve clarity.
- Refactored ChatMessage component to import formatMessageTime from a new date-utils file for better organization.
- Introduced LoadingProvider component for managing loading states with context and animations.
- Added PageTransition component to enhance page transition animations and improve user experience.
- Created index.ts file to streamline component exports.
- Adjusted import paths in various UI components for consistency.
- Created package-lock.json to manage project dependencies.
- Added jsconfig.json for improved JavaScript project configuration.
- Updated next.config.js to enable React strict mode and configure Webpack aliases.
- Modified tsconfig.json to adjust module resolution and include base URL for path mapping.
- Refactored layout.tsx to integrate LoadingProvider for better loading state management.
- Introduced loading.tsx components for account and chat interfaces, utilizing Skeleton for loading indicators.
…ding states

- Introduced new `page.tsx` for login with a simple message.
- Added `ChatInterfaceClient.tsx` as a placeholder for chat interface logic.
- Created `input.tsx` and `skeleton.tsx` components for UI consistency.
- Updated `Dockerfile` to use Node 18 and streamline dependency installation.
- Refactored `eslint.config.mjs` and `next.config.js` for improved module imports.
- Modified `package.json` to update project name and dependencies.
- Enhanced loading states in `loading.tsx` for chat and account interfaces.
- Removed unused `LoadingProvider` and `index.ts` files to clean up the codebase.
- Adjusted various components for consistency in code style and structure.
…istency

- Reformatted the .pre-commit-config.yaml file for better readability.
- Ensured consistent indentation for hook definitions across all repositories.
- Updated hooks for mypy and ruff to maintain alignment with project standards.
- Updated import statements in `gradient-button.tsx`, `input.tsx`, and `wavy-background.tsx` to utilize absolute paths for better maintainability and consistency across the codebase.
iLevyTate and others added 12 commits January 6, 2025 18:07
… .gitignore updates; include frontend structure and documentation
- Introduced `formatMessageTime` and `isToday` functions in `date.ts` for handling date-related operations.
- Added `cn` function for class name merging and a configuration object in `ui.ts` for managing UI transitions and styles.
- Deleted test files for components: `AgentResponse`, `ChatInterfaceClient`, `LoadingSpinner`, `MessageActions`, and hooks: `use-chat-scroll`, `use-media-query`.
- Removed Cypress end-to-end test files and associated screenshots and videos.
- Cleared out unused support files in Cypress to streamline testing setup.
…d agent configuration and message handling

- Updated AgentResponse to utilize a centralized agent configuration service, enhancing maintainability and scalability.
- Refactored ChatInterfaceClient to integrate a ChatService for message handling, replacing direct API calls with service methods.
- Improved message ID generation using uuid instead of crypto.randomUUID for consistency.
- Cleaned up unused imports and optimized component structure for better readability.
- Adjusted loading spinner and avatar components for consistent styling and functionality across the application.
- Deleted obsolete `chat.test.ts` file and replaced it with new tests for `ChatInterfaceClient` and `LoginPage`, ensuring better coverage and functionality validation.
- Introduced `CHAT_CONSTANTS` and `ERROR_MESSAGES` for centralized message handling and error management.
- Added `ChatService` for streamlined message sending and response formatting, improving the interaction with the chat API.
- Created `AgentConfigService` to manage agent configurations, enhancing maintainability and scalability.
- Implemented `useChatScroll` hook for automatic scrolling in chat interfaces.
- Updated `Message` type to include optional feedback, allowing for more flexible message handling.
@iLevyTate iLevyTate requested a review from sanders41 January 10, 2025 04:57
@sanders41 sanders41 changed the base branch from FrontEndRebuild to main January 10, 2025 12:55
Copy link
Member

@sanders41 sanders41 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like all the frontend checks are failing. It's possible the package version issue I mentioned in the package.json is the problem, but we won't know for sure until those are updated.

babel.config.js Outdated Show resolved Hide resolved
frontend/POSD.md Outdated Show resolved Hide resolved
frontend/README.md Outdated Show resolved Hide resolved
frontend/POSD.md Outdated Show resolved Hide resolved
frontend/README.md Outdated Show resolved Hide resolved
frontend/README.md Outdated Show resolved Hide resolved
frontend/README.md Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
frontend/package.json Outdated Show resolved Hide resolved
- Removed the end-to-end testing job from the GitHub Actions workflow to streamline CI processes.
- Added a new ESLint configuration file to enforce coding standards and improve code quality.
- Updated Dockerfile to include necessary system and runtime dependencies for the canvas library.
- Modified package.json to include new ESLint and Prettier dependencies, ensuring consistent code formatting and linting.
- Refactored login page styles for improved layout and readability.
- Cleaned up imports in ChatInterfaceClient component for better maintainability.
…ndencies and configurations

- Deleted obsolete package.json and package-lock.json files from the root directory.
- Updated frontend package-lock.json to reflect new dependencies including @emoji-mart/data, dompurify, eslint-plugin-prettier, and others.
- Enhanced frontend configurations with new libraries for improved functionality and code quality.
- Removed outdated dependencies and streamlined the package structure for better maintainability.
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.

2 participants