-
Notifications
You must be signed in to change notification settings - Fork 495
[CB] write unit tests #3928
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
base: devel
Are you sure you want to change the base?
[CB] write unit tests #3928
Conversation
83882ac to
5ea9ff5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive unit tests for various utilities and components in the CloudBeaver codebase, unskips previously disabled tests, and enforces named functions through ESLint configuration.
- Adds unit tests for core utilities (
isIp,isBrokenImage) and hooks (useSearch,useFuzzySearch,useObjectRef,useErrorDetails,useAdministrationSettings,useCombinedHandler) - Adds unit tests for UI components (
UploadArea,StaticImage,IconOrImage) - Updates ESLint configuration to enforce named functions with the
func-namesrule - Unskips and fixes previously disabled tests in
getTextFileReadingProcess,app-init, anduseCombinedHandler - Creates test utility mocks (
sMock,useSMock,useObservableRefMock) for consistent testing patterns
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/packages/eslint-config/flat.js | Adds func-names ESLint rule to enforce named functions |
| webapp/packages/core-utils/src/isIp.ts | Refactors IP validation logic into separate functions with improved IPv6 support |
| webapp/packages/core-utils/src/isIp.test.ts | Adds comprehensive tests for IPv4 and IPv6 validation |
| webapp/packages/core-utils/src/isBrokenImage.test.ts | Adds tests for image broken state detection |
| webapp/packages/core-utils/src/getTextFileReadingProcess.test.ts | Unskips test and improves console message handling |
| webapp/packages/core-utils/src/downloadImage.ts | Exports error message constant for testing purposes |
| webapp/packages/core-di/src/tests/app-init/app-init.test.ts | Unskips previously disabled initialization test |
| webapp/packages/core-blocks/src/useSearch.test.ts | Adds comprehensive tests for search hook with multiple strategies |
| webapp/packages/core-blocks/src/useObjectRef.test.ts | Rewrites tests with improved coverage of reference stability and binding |
| webapp/packages/core-blocks/src/useFuzzySearch.test.ts | Adds tests for fuzzy search functionality |
| webapp/packages/core-blocks/src/useErrorDetails.ts | Updates type signature for async open method |
| webapp/packages/core-blocks/src/useErrorDetails.test.tsx | Adds comprehensive tests for error details hook |
| webapp/packages/core-blocks/src/useCombinedHandler.test.ts | Unskips test and fixes mock implementation |
| webapp/packages/core-blocks/src/useAdministrationSettings.test.ts | Adds tests for administration settings hook |
| webapp/packages/core-blocks/src/tests/useSMock.ts | Creates mock utility for style hooks |
| webapp/packages/core-blocks/src/tests/useObservableRefMock.ts | Creates mock implementation for observable ref hook |
| webapp/packages/core-blocks/src/tests/sMock.ts | Creates mock utility for style composition |
| webapp/packages/core-blocks/src/UploadArea.test.tsx | Adds comprehensive tests for file upload component |
| webapp/packages/core-blocks/src/TimerIcon.test.tsx | Updates test to use standardized mock utilities |
| webapp/packages/core-blocks/src/TextPlaceholder.test.tsx | Updates test to use standardized mock utilities |
| webapp/packages/core-blocks/src/StatusMessage.tsx | Updates type signature for async onShowDetails callback |
| webapp/packages/core-blocks/src/StatusMessage.test.tsx | Updates test to use standardized mock utilities |
| webapp/packages/core-blocks/src/StaticImage.test.tsx | Adds comprehensive tests for static image component |
| webapp/packages/core-blocks/src/Link.test.tsx | Updates test to use standardized mock utilities |
| webapp/packages/core-blocks/src/IconOrImage.test.tsx | Adds comprehensive tests for icon/image component routing |
| webapp/packages/core-blocks/src/ErrorMessage.tsx | Updates type signature for async onShowDetails callback |
| webapp/packages/core-blocks/src/ErrorMessage.test.tsx | Updates test to use standardized mock utilities |
| webapp/packages/core-blocks/src/Cell.test.tsx | Updates test to use standardized mock utilities |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SychevAndrey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪🏻 a nice bunch of tests!
Let's try to use getByRole as much as possible according to priority guide
closes https://github.com/dbeaver/pro/issues/7563