-
Notifications
You must be signed in to change notification settings - Fork 109
All test cases #4385
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
All test cases #4385
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/test-library #4385 +/- ##
=====================================================
Coverage 66.73% 66.73%
=====================================================
Files 85 85
Lines 995 995
Branches 142 142
=====================================================
Hits 664 664
Misses 300 300
Partials 31 31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.scss
Outdated
Show resolved
Hide resolved
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.
Important changes about how derived data should be used required.
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseListWrapper/testCaseListWrapper.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseListWrapper/testCaseListWrapper.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseListWrapper/testCaseListWrapper.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseListWrapper/testCaseListWrapper.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseListWrapper/testCaseListWrapper.tsx
Outdated
Show resolved
Hide resolved
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.
Great. Now only minor nitpicks and questions left
app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.tsx
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughA comprehensive test case list feature was introduced, including new React components, TypeScript types, SCSS styles, constants, and mock data for test case management. Enhancements include improved dropdown styling, tag list empty state handling, asset type declarations, and updated internationalization messages. Pagination, filtering, and search functionalities are integrated, with supporting hooks and UI logic. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AllTestCasesPage
participant useTestCases
participant TestCaseList
participant Pagination
User->>AllTestCasesPage: Interacts (search, paginate)
AllTestCasesPage->>useTestCases: Get filtered test cases
useTestCases-->>AllTestCasesPage: Returns filtered data, loading state
AllTestCasesPage->>TestCaseList: Render test case list with props
TestCaseList->>TestCaseNameCell: Render test case name, status, tags
TestCaseList->>TestCaseExecutionCell: Render last execution, actions
AllTestCasesPage->>Pagination: Render pagination controls
User->>Pagination: Changes page/size
Pagination-->>AllTestCasesPage: Triggers page/size update
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate Unit Tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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.
Actionable comments posted: 8
🔭 Outside diff range comments (1)
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx (1)
53-53
:⚠️ Potential issueRemove console statement to fix ESLint warning.
The pipeline failure indicates an ESLint warning for the console.error statement. Consider using a proper logging mechanism or removing the console statement entirely.
- console.error(`Element with ID not found.`); + // Element not found - this should not happen in normal operation🧰 Tools
🪛 GitHub Actions: Build
[warning] 53-53: Unexpected console statement (no-console).
♻️ Duplicate comments (2)
app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx (1)
44-48
: LGTM! Props interface addresses previous coupling concerns.The component now accepts only the specific props it needs (
status
,name
,tags
) rather than the full TestCase object, which addresses the previous review feedback about avoiding coupling with the domain type.app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.tsx (1)
42-49
: Consider memoizing the component.Based on the past review comment about memoization, consider wrapping this component with
React.memo
to prevent unnecessary re-renders, especially since it receives several callback props.+import { useState, useCallback, memo } from 'react'; -export const TestCaseDetailsPage = ({ +export const TestCaseDetailsPage = memo(({ testCases, loading, searchValue, setSearchValue, deleteTestCase, duplicateTestCase, -}: TestCaseDetailsPageProps) => { +}: TestCaseDetailsPageProps) => { // ... component implementation -}; +});
🧹 Nitpick comments (16)
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.scss (1)
90-95
: Scope no-tags message under BEM
To avoid global class leakage, nest.no-tags-message
inside the.tag-list--no-tags
block:.tag-list { &--no-tags { padding-left: 0; height: auto; + .no-tags-message { + font-size: 11px; + line-height: 16px; + font-weight: 400; + color: var(--rp-ui-base-e-400); + } } }app/.eslintrc (1)
106-116
: Verify if rule duplication is necessary.These TypeScript-specific rules (
import/prefer-default-export
andimport/extensions
) duplicate the existing base rules (lines 37 and 68-77). While explicit overrides can be intentional for TypeScript files, consider if this duplication is necessary or if the base rules would suffice.app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.scss (1)
27-30
: Unify theming variables for consistency.This block mixes an SCSS variable (
$COLOR--bg-100
) and a CSS custom property (var(--rp-ui-base-e-100)
). Confirm that$COLOR--bg-100
is defined in your theme imports or replace it with the corresponding CSS variable to keep theming consistent:.pagination { background: var(--rp-ui-bg-100); // if available border-top: 1px solid var(--rp-ui-base-e-100); /* ... */ }app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.scss (1)
40-43
: Scope your SVG selector for clarity.The nested
svg
will compile to.test-case-library-page__breadcrumb svg
. To make the intent clearer alongside&-icon
, nest like this:&__breadcrumb { - &-icon, - svg { + &-icon, + & svg { height: 16px; } }app/localization/translated/zh.json (1)
1332-1339
: Consider fullwidth punctuation and ellipsis for Chinese text
To adhere to Chinese typography conventions, replace ASCII parentheses and three-dot ellipsis with fullwidth characters. For example:- "TestCaseLibraryPage.copySuffix": "(副本)", + "TestCaseLibraryPage.copySuffix": "(副本)", - "TestCaseList.loadingMessage": "正在加载测试用例...", + "TestCaseList.loadingMessage": "正在加载测试用例……"app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts (1)
76-87
: Consider removing unnecessary exposure of raw testCases.The
testCases
array is exposed but consumers likely only needfilteredTestCases
. This reduces the API surface and prevents misuse.return { - testCases, filteredTestCases, loading, hasTestCases, searchValue, setSearchValue, deleteTestCase, duplicateTestCase, updateTestCase, };
app/src/components/testCaseList/types.ts (2)
17-17
: Consider renaming TestCaseStatus for clarity.The values 'low', 'normal', 'high' suggest priority levels rather than execution status. Consider renaming to
TestCasePriority
or updating values to actual status terms.-export type TestCaseStatus = 'low' | 'normal' | 'high'; +export type TestCasePriority = 'low' | 'normal' | 'high';Or if this represents execution status:
-export type TestCaseStatus = 'low' | 'normal' | 'high'; +export type TestCaseStatus = 'passed' | 'failed' | 'skipped' | 'pending';
19-25
: Consider type consistency for better maintainability.The mixed
string | number
type forid
could lead to inconsistencies. Also,lastExecution
as string might benefit from more specific typing.export interface TestCase { - id: string | number; + id: string; name: string; status: TestCaseStatus; tags: string[]; - lastExecution: string; + lastExecution: string | Date; // or just Date if always a date }app/localization/translated/es.json (2)
1328-1329
: Consider unifying “noTagsAdded” phrasing
The message"No se agregaron etiquetas"
is accurate, but other “no-results” entries consistently use “No hay…”. For stylistic consistency, you might prefer:- "LinkedTestCasesTab.noTagsAdded": "No se agregaron etiquetas", + "LinkedTestCasesTab.noTagsAdded": "No hay etiquetas agregadas",
1330-1341
: Verify casing in copy suffix and TestCaseList entries
All TestCaseList messages read clearly. One minor style tweak: inTestCaseLibraryPage.copySuffix
, consider lower-casing the suffix to"(copia)"
to align with typical Spanish UI conventions:- "TestCaseLibraryPage.copySuffix": "(Copia)", + "TestCaseLibraryPage.copySuffix": "(copia)",app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.tsx (3)
58-60
: Complete the edit handler implementation.The
handleEdit
function is currently empty and needs implementation to provide edit functionality for test cases.Would you like me to help implement the edit handler or create an issue to track this TODO item?
79-81
: Complete the move handler implementation.The
handleMove
function is currently empty and needs implementation to provide move functionality for test cases.Would you like me to help implement the move handler or create an issue to track this TODO item?
91-94
: Apply consistent useCallback usage.The
changePageSize
function should useuseCallback
for consistency with other event handlers in this component, especially since it's passed as a prop to the Pagination component.Apply this change for consistency:
- const changePageSize = (size: number) => { - setPageSize(size); - setActivePage(DEFAULT_CURRENT_PAGE); - }; + const changePageSize = useCallback((size: number) => { + setPageSize(size); + setActivePage(DEFAULT_CURRENT_PAGE); + }, []);app/src/components/testCaseList/testCaseList.tsx (1)
32-43
: Consider making itemsPerPage optional with a default value.The
itemsPerPage
prop is required but could be optional with a default value for better component usability.interface TestCaseListProps { testCases?: TestCase[]; loading?: boolean; currentPage?: number; - itemsPerPage: number; + itemsPerPage?: number; searchValue?: string; onSearchChange?: (value: string) => void; onEdit?: (testCase: TestCase) => void; onDelete?: (testCase: TestCase) => void; onDuplicate?: (testCase: TestCase) => void; onMove?: (testCase: TestCase) => void; }And add a default value in the component:
export const TestCaseList = memo( ({ testCases = mockTestCases, loading = false, currentPage = DEFAULT_CURRENT_PAGE, - itemsPerPage, + itemsPerPage = DEFAULT_ITEMS_PER_PAGE, searchValue = '',app/src/components/testCaseList/mockData.ts (2)
24-33
: Fix truncated tag names in mock data.Several tag names appear to be truncated or incomplete, which could affect UI testing and development experience.
Apply these fixes for more realistic mock data:
tags: [ 'sso system', 'user interface improvements', - 'battery usage analysis for a', - 'cross-platform app speed t', + 'battery usage analysis', + 'cross-platform app speed test', 'ui', 'performance test', 'security check', 'user flow', ],
19-308
: Consider reducing mock data size for better performance.The mock array contains 35 items which might be excessive for development and testing. Consider reducing to 10-15 representative items for better performance during development.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
app/package-lock.json
is excluded by!**/package-lock.json
app/src/common/img/newIcons/priority-inline.svg
is excluded by!**/*.svg
📒 Files selected for processing (33)
.gitignore
(1 hunks)app/.eslintrc
(1 hunks)app/localization/translated/be.json
(1 hunks)app/localization/translated/es.json
(1 hunks)app/localization/translated/ru.json
(1 hunks)app/localization/translated/uk.json
(1 hunks)app/localization/translated/zh.json
(1 hunks)app/package.json
(1 hunks)app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.jsx
(4 hunks)app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.scss
(2 hunks)app/src/components/testCaseList/index.ts
(1 hunks)app/src/components/testCaseList/messages.ts
(1 hunks)app/src/components/testCaseList/mockData.ts
(1 hunks)app/src/components/testCaseList/testCaseCell.scss
(1 hunks)app/src/components/testCaseList/testCaseExecutionCell/index.ts
(1 hunks)app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
(1 hunks)app/src/components/testCaseList/testCaseList.constants.ts
(1 hunks)app/src/components/testCaseList/testCaseList.scss
(1 hunks)app/src/components/testCaseList/testCaseList.tsx
(1 hunks)app/src/components/testCaseList/testCaseNameCell/index.ts
(1 hunks)app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx
(1 hunks)app/src/components/testCaseList/types.ts
(1 hunks)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/messages.js
(1 hunks)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx
(1 hunks)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.scss
(2 hunks)app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts
(1 hunks)app/src/pages/inside/testCaseLibraryPage/messages.js
(1 hunks)app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/index.ts
(1 hunks)app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.scss
(1 hunks)app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.tsx
(1 hunks)app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.jsx
(3 hunks)app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.scss
(1 hunks)app/src/types/global.d.ts
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (4)
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx (2)
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/mockData.jsx (2)
tags
(27-38)cx
(25-25)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/messages.js (2)
messages
(19-28)messages
(19-28)
app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts (2)
app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.jsx (1)
useTestCases
(36-44)app/src/components/testCaseList/types.ts (1)
TestCase
(19-25)
app/src/components/testCaseList/mockData.ts (2)
app/src/components/testCaseList/index.ts (4)
mockTestCases
(18-18)STATUS_TYPES
(18-18)ITEMS_PER_PAGE_OPTIONS
(18-18)FILTER_OPTIONS
(18-18)app/src/components/testCaseList/types.ts (2)
TestCase
(19-25)FilterOption
(27-30)
app/src/components/testCaseList/testCaseList.tsx (7)
app/src/components/fields/searchField/searchField.jsx (3)
cx
(24-24)SearchField
(26-90)SearchField
(26-90)app/src/components/testCaseList/types.ts (1)
TestCase
(19-25)app/src/components/testCaseList/mockData.ts (1)
mockTestCases
(19-308)app/src/components/testCaseList/testCaseList.constants.ts (1)
DEFAULT_CURRENT_PAGE
(19-19)app/src/components/testCaseList/messages.ts (1)
messages
(19-64)app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx (1)
TestCaseNameCell
(50-64)app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx (1)
TestCaseExecutionCell
(40-87)
🪛 GitHub Actions: Build
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx
[warning] 53-53: Unexpected console statement (no-console).
app/src/types/global.d.ts
[warning] 63-63: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any).
app/src/components/testCaseList/testCaseCell.scss
[error] 59-59: Unexpected hex color '#4d70ed' (color-no-hex).
[error] 66-66: Unexpected hex color '#fdc63a' (color-no-hex).
[error] 72-72: Unexpected hex color '#dc5959' (color-no-hex).
🔇 Additional comments (53)
.gitignore (1)
11-11
: Approve.cursor
ignore entry.
Adding.cursor
to the ignore list will prevent accidental commits of cursor-related temporary files.app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.scss (2)
61-63
: LGTM! Clean CSS implementation for hiding the arrow.The
.hide-arrow
modifier class properly removes the right padding when the arrow is hidden, ensuring consistent visual spacing.
77-79
: LGTM! Appropriate font-weight for bold styling.The
.bold-value
modifier class uses a sensible font-weight of 600 for semi-bold text, which provides good readability without being too heavy.app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.jsx (6)
41-42
: LGTM! Props are properly typed.The new boolean props
hideArrow
andboldValue
are correctly defined in PropTypes.
58-59
: LGTM! Sensible default values.Both props default to
false
, ensuring backwards compatibility and maintaining existing behavior.
138-139
: LGTM! Props properly destructured.The new props are correctly included in the destructuring assignment for use in the render method.
152-152
: LGTM! Conditional CSS class application.The
hide-arrow
class is properly applied conditionally based on thehideArrow
prop value.
156-156
: LGTM! Conditional bold styling.The
bold-value
class is correctly applied to the value span when theboldValue
prop is true.
157-159
: LGTM! Clean conditional rendering.The arrow icon is properly hidden when
hideArrow
is true, using standard React conditional rendering patterns.app/src/types/global.d.ts (5)
17-21
: SVG module declaration is correct.
The ambient declaration for.svg
imports correctly types them as strings (URLs), matching common webpack/CRA setups.
23-27
: SCSS module declaration is correct.
Typing SCSS modules as a{ [key: string]: string }
map aligns with CSS-modules conventions.
29-33
: CSS module declaration is correct.
This declaration ensures.css
module imports yield a map of class names to strings.
35-39
: Image asset module declarations are consistent.
PNG, JPG, JPEG, GIF, and WEBP imports are all correctly typed as string URLs.Also applies to: 41-44, 46-49, 51-54, 56-59
1-66
: Verify ambient declaration inclusion.
Confirm thatapp/src/types/global.d.ts
is included in yourtsconfig.json
(viainclude
ortypeRoots
) so these module declarations are recognized by the compiler.🧰 Tools
🪛 GitHub Actions: Build
[warning] 63-63: Unexpected any. Specify a different type (@typescript-eslint/no-explicit-any).
app/package.json (1)
30-30
:❓ Verification inconclusive
Verify UI Kit upgrade
Ensure the^0.0.1-alpha.59
tag is published on NPM and confirm no breaking changes affect the new Test Case List components.Also run the full test suite locally to catch regressions.
🏁 Script executed:
npm view @reportportal/ui-kit versions --jsonLength of output: 1240
UI Kit version availability confirmed
The^0.0.1-alpha.59
release is published on npm. Please take the following steps before merging:
- Review the @reportportal/ui-kit changelog or release notes for any breaking changes affecting the Test Case List components.
- Run the full test suite locally to catch any regressions.
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.scss (1)
35-38
: Confirm modifier application
The&--no-tags
BEM modifier correctly removes padding and allows auto height. Please verify that the React component appliestag-list--no-tags
whentags
is empty.app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/messages.js (1)
24-27
:✅ Verification successful
Verify translation entries
Ensure the newLinkedTestCasesTab.noTagsAdded
ID is present in all locale JSON files:
🏁 Script executed:
rg -L '"LinkedTestCasesTab.noTagsAdded"' -n app/localization/translated
Length of output: 556
Translation entries verified
The keyLinkedTestCasesTab.noTagsAdded
is present in all locale JSON files (zh, uk, es, ru, be).app/src/components/testCaseList/testCaseNameCell/index.ts (1)
17-18
: Barrel export is correct
Theindex.ts
re-export ofTestCaseNameCell
follows the project's barrel pattern. No issues found.app/localization/translated/uk.json (1)
1326-1339
:✅ Verification successful
Verify translation consistency and grouping for new test case keys
Ensure these new entries forLinkedTestCasesTab
,TestCaseList
, andTestCaseLibraryPage
are correctly translated and referenced in the code, and exist in all other locale files (e.g.,be.json
,es.json
,ru.json
,zh.json
). Consider groupingTestCaseLibraryPage.copySuffix
with otherTestCaseLibraryPage
keys for logical cohesion.Run this script to confirm presence across locales:
🏁 Script executed:
#!/bin/bash # Verify test case translation keys across all locale files rg -Hn '"\(LinkedTestCasesTab\|TestCaseList\|TestCaseLibraryPage\)\.' app/localization/translated/*.jsonLength of output: 481
Let's re-run the verification with a corrected regex to properly match those keys across all locale files:
🏁 Script executed:
#!/bin/bash # Verify test case translation keys across all locale files with corrected regex rg -Hn '"(LinkedTestCasesTab|TestCaseList|TestCaseLibraryPage)\.' app/localization/translated/*.jsonLength of output: 7399
All test case translation keys are present in every locale
I confirmed thatLinkedTestCasesTab.*
,TestCaseList.*
, andTestCaseLibraryPage.copySuffix
appear in be.json, es.json, ru.json, uk.json, and zh.json. No missing entries were found. SincecopySuffix
is currently the onlyTestCaseLibraryPage
key, there’s no additional grouping needed—future page‐level strings can be organized together as they’re added.app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/index.ts (1)
17-17
: LGTM!Clean barrel module implementation following standard patterns.
app/src/components/testCaseList/testCaseExecutionCell/index.ts (1)
17-17
: LGTM!Consistent barrel module implementation that aligns with the project's modular structure.
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx (1)
71-79
: LGTM!The empty state implementation is well-designed with proper internationalization support and consistent styling patterns. The early return prevents unnecessary processing when no tags are present.
app/src/components/testCaseList/index.ts (1)
17-18
: Barrel export is concise and clear.This re-export setup centralizes
TestCaseList
and its related constants/mock data, simplifying imports across the codebase. Looks good.app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.scss (1)
46-50
: Validate layout changes after removing spacing rules.You’ve dropped
justify-content
,align-items
,padding
, andgap
from&__content
. Please verify against the design spec and update any snapshots or tests as needed to ensure the new layout matches expectations.app/localization/translated/zh.json (2)
1326-1327
: Approve new LinkedTestCasesTab localization entries
The keysLinkedTestCasesTab.noTagsAdded
andLinkedTestCasesTab.showLess
match the code and are correctly formatted as JSON.
1328-1331
: Approve TestCaseList localization entries
Entries forTestCaseList.deleteTestCase
,.duplicate
,.editTestCase
, and.moveTestCaseTo
align with component props and maintain proper JSON syntax.app/localization/translated/ru.json (1)
1327-1341
: Add Russian translations for TestCase management UI
New entries cover the LinkedTestCasesTab and TestCaseList components, matching the message IDs introduced in the PR. Keys follow the existing naming conventions, there are no duplicates, and the JSON remains syntactically valid.app/src/components/testCaseList/messages.ts (1)
19-64
: LGTM! Well-structured internationalization messages.The message definitions follow React Intl best practices with consistent naming conventions and clear, descriptive default messages. The structure is clean and properly organized for the test case list UI components.
app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.jsx (3)
36-44
: LGTM! Clean hook integration and state management.The destructuring of the useTestCases hook is well-organized and the extracted values cover all necessary aspects of test case management including filtering, loading states, and action handlers.
60-71
: LGTM! Effective conditional rendering pattern.The conditional rendering based on
hasTestCases
provides a clean user experience, showing either the test case details or an empty state. The props passed to TestCaseDetailsPage are comprehensive and well-structured.
27-27
:✅ Verification successful
Verify the useTestCases hook import.
Ensure that the useTestCases hook exists and is properly exported from the specified path.
🏁 Script executed:
#!/bin/bash # Description: Verify useTestCases hook exists and is properly exported # Check if useTestCases hook file exists fd -t f "useTestCases" app/src/pages/inside/testCaseLibraryPage/hooks/ --exec echo "Found: {}" # Search for useTestCases hook definition ast-grep --pattern 'export $_ useTestCases'Length of output: 210
🏁 Script executed:
#!/bin/bash # Inspect export statements in useTestCases.ts grep -R "export" -n app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts || echo "No export statements found"Length of output: 121
useTestCases hook import is correct.
The
useTestCases
hook is defined and exported fromapp/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts
, so the import path is valid.app/src/components/testCaseList/testCaseList.scss (6)
17-25
: LGTM! Well-structured main container styles.The flexbox layout with proper overflow handling creates a solid foundation for the test case list component.
31-38
: LGTM! Effective hover states for table rows.The hover effect with border and border-radius provides good visual feedback. The use of CSS custom properties ensures consistent theming.
40-66
: LGTM! Clean loading and no-results states.The loading and no-results sections are well-designed with appropriate spacing and typography. The centered layout and consistent color usage enhance the user experience.
68-125
: LGTM! Comprehensive controls section styling.The controls layout effectively uses flexbox for responsive alignment and spacing. The filter icon styles provide appropriate interactive feedback.
127-179
: LGTM! Thorough responsive design implementation.The media queries cover key breakpoints and appropriately adjust layout, typography, and spacing for different screen sizes. The progressive enhancement approach ensures good usability across devices.
35-35
:❓ Verification inconclusive
Verify CSS custom properties are defined.
The stylesheet uses several CSS custom properties for colors. Ensure these are properly defined in the design system or CSS root.
Also applies to: 113-113, 118-118
🏁 Script executed:
#!/bin/bash # Description: Verify CSS custom properties are defined in the codebase # Search for CSS custom property definitions rg -A 2 -B 2 "--rp-ui-base-topaz-focused|--rp-ui-base-e-400|--rp-ui-base-e-100|--rp-ui-base-almost-black|--rp-ui-base-topaz"Length of output: 638
Let's correct the ripgrep invocation and search again for those CSS variables:
🏁 Script executed:
#!/bin/bash # Description: Verify CSS custom property definitions in the codebase # Search for CSS custom property definitions with correct regex syntax rg -E "(--rp-ui-base-topaz-focused|--rp-ui-base-e-400|--rp-ui-base-e-100|--rp-ui-base-almost-black|--rp-ui-base-topaz)" -C 2Length of output: 523
Let’s try a broader grep search (falling back from ripgrep) to find any “--rp-ui-base…” declarations:
🏁 Script executed:
#!/bin/bash # Description: Fallback grep search for CSS custom property definitions grep -R --include '*.scss' --include '*.css' -- '--rp-ui-base' -n .Length of output: 11628
Let’s check for actual CSS variable definitions (lines like
--rp-ui-base-...: value;
):
🏁 Script executed:
#!/bin/bash # Description: Search for CSS custom property definitions in .scss/.css files grep -R --include '*.scss' --include '*.css' -n '^\s*--rp-ui-base-[a-z0-9-]\+:' .Length of output: 83
Verify CSS custom properties are defined globally
I searched all .scss/.css files and did not find any local declarations for these variables:
- --rp-ui-base-topaz-focused
- --rp-ui-base-e-400
- --rp-ui-base-e-100
- --rp-ui-base-almost-black
- --rp-ui-base-topaz
They are used in:
- app/src/components/testCaseList/testCaseList.scss (line 35: border; lines 113, 118: color)
Please confirm that these custom properties are declared in your design system or a global stylesheet (e.g. under
:root
) and that it’s imported before this component. If they’re missing, add the definitions or import the correct theme file.app/src/components/testCaseList/testCaseList.constants.ts (1)
17-20
: LGTM! Sensible default constants.The constants provide reasonable default values for pagination and filtering. The naming is clear and the values are appropriate for a test case list interface.
app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts (5)
17-19
: LGTM: Clean imports with proper type safety.The imports are well-organized and follow TypeScript best practices.
21-24
: LGTM: State initialization follows React patterns.The state setup is correct with proper TypeScript typing.
42-53
: LGTM: Efficient filtering with proper memoization.The search logic is well-implemented with case-insensitive matching across name and tags. The memoization dependencies are correct.
55-57
: LGTM: Simple and effective delete operation.The delete function correctly filters out the target test case by ID.
68-70
: LGTM: Clean update implementation with immutable patterns.The update function correctly uses object spread for immutable updates.
app/src/components/testCaseList/types.ts (1)
27-30
: LGTM: Simple and effective filter option interface.The FilterOption interface is well-designed for dropdown and filter components.
app/localization/translated/be.json (1)
1327-1340
:✅ Verification successful
New Test Case localization keys look correct
These keys for
LinkedTestCasesTab
andTestCaseList
align with the newly added UI components and messages.
🏁 Script executed:
#!/bin/bash # Verify new localization keys in all translated JSON files keys=( "LinkedTestCasesTab.noTagsAdded" "LinkedTestCasesTab.showLess" "TestCaseList.deleteTestCase" "TestCaseList.duplicate" "TestCaseList.editTestCase" "TestCaseList.moveTestCaseTo" "TestCaseLibraryPage.copySuffix" "TestCaseList.allTestCasesTitle" "TestCaseList.executionHeader" "TestCaseList.loadingMessage" "TestCaseList.nameHeader" "TestCaseList.noResultsEmptyMessage" "TestCaseList.noResultsFilteredMessage" "TestCaseList.searchPlaceholder" ) for file in app/localization/translated/*.json; do for key in "${keys[@]}"; do jq -e --arg k "$key" 'has($k)' "$file" > /dev/null \ || echo "Missing $key in $file" done doneLength of output: 38347
Localization coverage verified
- Confirmed all new
LinkedTestCasesTab.*
andTestCaseList.*
keys exist in the main translation files (be.json
,es.json
,ru.json
,uk.json
,zh.json
).- The
whitelist_*.json
files use an array format for override keys and aren’t expected to mirror the full key set, so their “missing key” errors can be ignored.All primary locales include the new entries—no further changes required.
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx (2)
32-38
: LGTM! Props interface properly addresses previous feedback.The component now accepts only the specific props it needs (
lastExecution
,onEdit
,onDelete
,onDuplicate
,onMove
) instead of the entire test case object, and all handlers are required rather than optional. This addresses the coupling and optional handler concerns raised in previous reviews.
40-87
: Clean implementation with proper state management and internationalization.The component correctly:
- Manages popover state internally
- Uses react-intl for localized menu labels
- Provides a consistent menu structure with proper event handling
- Implements accessible focus states via PopoverControl
app/src/components/testCaseList/testCaseCell.scss (1)
17-145
: Well-structured CSS with good use of flexbox and CSS variables.The overall styling structure is clean and follows good practices:
- Proper use of flexbox for layouts
- Consistent spacing and sizing
- Good hover and focus states for interactive elements
- Appropriate use of CSS variables throughout most of the file
🧰 Tools
🪛 GitHub Actions: Build
[error] 59-59: Unexpected hex color '#4d70ed' (color-no-hex).
[error] 66-66: Unexpected hex color '#fdc63a' (color-no-hex).
[error] 72-72: Unexpected hex color '#dc5959' (color-no-hex).
app/src/pages/inside/testCaseLibraryPage/messages.js (1)
24-51
: Well-structured internationalization messages for pagination UI.The new message definitions follow the established naming conventions and provide clear, descriptive text for pagination controls and test case operations. The IDs are properly namespaced with
TestCaseLibraryPage.
prefix.app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx (1)
50-64
: Clean component structure with proper accessibility.The component implementation is well-structured with:
- Proper use of CSS modules and class binding
- Accessibility considerations (title attribute for name tooltip)
- Clean separation of concerns between status icon, name, and tags
app/src/components/testCaseList/testCaseList.tsx (2)
45-57
: Well-implemented memoized component with good default values.The component is properly memoized and provides sensible default values for optional props. The use of mock data as a default helps with development and testing.
116-122
: Good implementation following past review feedback.The SearchField props are correctly implemented without redundant duplication, addressing the previous review comment effectively.
app/src/components/testCaseList/mockData.ts (1)
310-314
: Good use of const assertion for type safety.The
STATUS_TYPES
object withas const
assertion provides good type safety and prevents accidental mutations.
app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.scss
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.scss
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.scss
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.scss
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/testCaseDetailsPage/testCaseDetailsPage.tsx
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.tsx
Outdated
Show resolved
Hide resolved
app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.tsx
Outdated
Show resolved
Hide resolved
@coderabbitai review |
✅ Actions performedReview triggered.
|
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.
Actionable comments posted: 2
♻️ Duplicate comments (1)
app/src/components/testCaseList/testCaseList.tsx (1)
102-108
: Duplicate props were re-introduced after prior feedback
BothsetSearchValue
andonFilterChange
receive the same callback. A previous review asked to expose only one prop to avoid redundancy. Please drop one of them unless the API divergence is really expected.
🧹 Nitpick comments (3)
app/src/pages/inside/testCaseLibraryPage/expandedOptions/expandedOptions.tsx (1)
30-32
: Import path smells like relative-hell – consider alias
Imports such as'../hooks/useTestCases'
become brittle as the folder depth changes. The project already uses path aliases elsewhere (components/...
). ExposeuseTestCases
through an alias (e.g.,pages/testCaseLibrary/hooks
) to keep imports stable.app/src/components/testCaseList/testCaseList.tsx (1)
94-95
:isEmptyList
is overly verbose
!value.length
already covers the empty array case; the second condition is redundant.-const isEmptyList = (value: TestCase[]) => !value.length || value.length === 0; +const isEmptyList = (value: TestCase[]) => value.length === 0;app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.tsx (1)
59-62
: PersistpageSize
change in callback to keep memoization cheap
changePageSize
recreates each render and is passed toPagination
. Wrap it inuseCallback
to prevent unnecessary re-renders of the pagination component.-const changePageSize = (size: number) => { +const changePageSize = useCallback((size: number) => { setPageSize(size); setActivePage(DEFAULT_CURRENT_PAGE); -}; +}, []);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
app/package-lock.json
is excluded by!**/package-lock.json
app/src/common/img/newIcons/priority-inline.svg
is excluded by!**/*.svg
📒 Files selected for processing (32)
.gitignore
(1 hunks)app/package.json
(1 hunks)app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.jsx
(4 hunks)app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.scss
(2 hunks)app/src/components/testCaseList/constants.ts
(1 hunks)app/src/components/testCaseList/index.ts
(1 hunks)app/src/components/testCaseList/messages.ts
(1 hunks)app/src/components/testCaseList/mockData.ts
(1 hunks)app/src/components/testCaseList/priorityIcon/index.ts
(1 hunks)app/src/components/testCaseList/priorityIcon/priorityIcon.scss
(1 hunks)app/src/components/testCaseList/priorityIcon/priorityIcon.tsx
(1 hunks)app/src/components/testCaseList/testCaseExecutionCell/index.ts
(1 hunks)app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.scss
(1 hunks)app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
(1 hunks)app/src/components/testCaseList/testCaseList.scss
(1 hunks)app/src/components/testCaseList/testCaseList.tsx
(1 hunks)app/src/components/testCaseList/testCaseNameCell/index.ts
(1 hunks)app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.scss
(1 hunks)app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx
(1 hunks)app/src/components/testCaseList/types.ts
(1 hunks)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/messages.js
(1 hunks)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx
(1 hunks)app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.scss
(2 hunks)app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.scss
(1 hunks)app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.tsx
(1 hunks)app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/index.ts
(1 hunks)app/src/pages/inside/testCaseLibraryPage/expandedOptions/expandedOptions.scss
(1 hunks)app/src/pages/inside/testCaseLibraryPage/expandedOptions/expandedOptions.tsx
(3 hunks)app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts
(1 hunks)app/src/pages/inside/testCaseLibraryPage/messages.js
(1 hunks)app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.jsx
(0 hunks)app/src/types/global.d.ts
(1 hunks)
💤 Files with no reviewable changes (1)
- app/src/pages/inside/testCaseLibraryPage/testCaseLibraryPage.jsx
✅ Files skipped from review due to trivial changes (12)
- app/src/pages/inside/testCaseLibraryPage/expandedOptions/expandedOptions.scss
- app/src/components/testCaseList/priorityIcon/index.ts
- app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/index.ts
- app/src/components/testCaseList/testCaseExecutionCell/index.ts
- app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.scss
- app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.scss
- app/src/components/testCaseList/constants.ts
- app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.scss
- app/src/components/testCaseList/priorityIcon/priorityIcon.scss
- app/src/components/testCaseList/testCaseNameCell/index.ts
- app/src/components/testCaseList/types.ts
- app/src/components/testCaseList/mockData.ts
🚧 Files skipped from review as they are similar to previous changes (15)
- .gitignore
- app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.scss
- app/package.json
- app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.scss
- app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/messages.js
- app/src/pages/inside/productVersionPage/linkedTestCasesTab/tagList/tagList.jsx
- app/src/components/testCaseList/testCaseList.scss
- app/src/components/testCaseList/index.ts
- app/src/components/testCaseList/messages.ts
- app/src/types/global.d.ts
- app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx
- app/src/pages/inside/testCaseLibraryPage/hooks/useTestCases.ts
- app/src/components/inputs/inputDropdownSorting/inputDropdownSorting.jsx
- app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
- app/src/pages/inside/testCaseLibraryPage/messages.js
🧰 Additional context used
🧬 Code Graph Analysis (1)
app/src/components/testCaseList/priorityIcon/priorityIcon.tsx (2)
app/src/components/testCaseList/types.ts (1)
TestCaseStatus
(17-17)app/src/components/testCaseList/priorityIcon/index.ts (1)
PriorityIcon
(17-17)
🔇 Additional comments (3)
app/src/components/testCaseList/priorityIcon/priorityIcon.tsx (1)
41-47
: Gracefully handle unexpectedstatus
values
status
is a union type, but runtime callers may still send an invalid string (e.g., from JSON). AccessingiconMap[status]
with an unknown key will renderundefined
and break layout. Provide a fallback:- {iconMap[status]} + {iconMap[status] ?? iconMap.normal}app/src/components/testCaseList/testCaseList.tsx (1)
32-39
:itemsPerPage
lacks a default – guard against0 | undefined
itemsPerPage
is required but nothing prevents callers from passing0
or omitting it in the future. Provide a sane default (e.g.,DEFAULT_ITEMS_PER_PAGE
) to avoid division-by-zero downstream.-interface TestCaseListProps { +interface TestCaseListProps { … - itemsPerPage: number; + itemsPerPage?: number; … }…and update the destructuring with a default.
app/src/pages/inside/testCaseLibraryPage/allTestCasesPage/allTestCasesPage.tsx (1)
47-50
: Guard against division by zero when calculatingtotalPages
IfpageSize
ever becomes0
(e.g., mis-configured option),Math.ceil
will yieldInfinity
, breakingPagination
.-const totalPages = Math.ceil(totalItems / pageSize); +const totalPages = pageSize ? Math.ceil(totalItems / pageSize) : 1;
app/src/pages/inside/testCaseLibraryPage/expandedOptions/expandedOptions.tsx
Show resolved
Hide resolved
@ViktorSoroka07 It is ready to merge I believe |
@Guria, waiting for @AmsterGet final approve |
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
app/src/components/testCaseList/testCaseExecutionCell/testCaseExecutionCell.tsx
Outdated
Show resolved
Hide resolved
|
PR Checklist
develop
for features/bugfixes, other if mentioned in the task)npm run lint
) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.npm run build
)?dev
npm script)manage:translations
script?Visuals
Summary by CodeRabbit