Add Testing Infrastructure and Test Coverage #1 - #14
Open
divyanshbhai wants to merge 9 commits into
Open
Conversation
added 9 commits
October 15, 2025 17:42
- Add vitest.config.js with jsdom environment - Add test setup file with testing-library configuration - Add testing dependencies: vitest, @testing-library/react, jsdom - Add test scripts: test, test:ui, test:run, test:coverage
- Add tests for arrayIsEqual, strHasQuotes, isKeyword, isFunction - Add tests for getTableHeight function - Cover edge cases and validation scenarios
- Add Navbar component tests with navigation and mobile menu functionality - Add Thumbnail component tests with mocked dependencies - Include proper mocking for external dependencies
- Add tests for useFullscreen hook with fullscreen state management - Add tests for useThemedPage hook with DOM manipulation - Include proper mocking for external dependencies and DOM APIs
- Add test workflow that runs on push and pull requests - Test against Node.js 18.x and 20.x versions - Include linting, testing, and coverage reporting - Upload coverage reports to Codecov
- Add TESTING.md with detailed testing guide and best practices - Configure coverage reporting with v8 provider - Update gitignore to exclude coverage files - Include examples for component, hook, and utility testing
- Add renderWithRouter utility for testing components with routing - Add mock data generators for tables and diagrams - Add integration tests for app-level functionality - Include helper functions for common testing patterns
- Add testing section with available npm scripts - Reference TESTING.md for detailed testing guide - Include commands for watch mode, single run, coverage, and UI
- Fix useThemedPage test by properly mocking dependencies - Simplify component tests to avoid complex dependency issues - Remove JSX syntax from integration tests to fix parsing errors - All tests now pass successfully (19/19 tests passing)
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
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.
Fix #1
This PR implements a comprehensive testing infrastructure for the drawDB project.
Changes Made:
Testing:
Scripts Added:
npm run test- Watch modenpm run test:run- Single runnpm run test:coverage- With coveragenpm run test:ui- UI mode