Skip to content

Conversation

@DmytroChebakov2191
Copy link

@DmytroChebakov2191 DmytroChebakov2191 commented Nov 24, 2025

PR Checklist

  • Have you verified that the PR is pointing to the correct target branch? (develop for features/bugfixes, other if mentioned in the task)
  • Have you verified that your branch is consistent with the target branch and has no conflicts? (if not, make a rebase under the target branch)
  • Have you checked that everything works within the branch according to the task description and tested it locally?
  • Have you run the linter (npm run lint) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.
  • Have you run the tests locally and added/updated them if needed?
  • Have you checked that app can be built (npm run build)?
  • Have you checked that no new circular dependencies appreared with your changes? (the webpack plugin reports circular dependencies within the dev npm script)
  • Have you made sure that all the necessary pipelines has been successfully completed?
  • If the task requires translations to be updated, have you done this by running the manage:translations script?
  • Have you added the link to the PR in the Jira ticket comments?

Visuals

image image

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/import-modal-destination-folder-selection

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.59%. Comparing base (aba368f) to head (396f973).

Additional details and impacted files
@@                  Coverage Diff                  @@
##           feature/test-library    #4747   +/-   ##
=====================================================
  Coverage                 72.59%   72.59%           
=====================================================
  Files                        79       79           
  Lines                       905      905           
  Branches                    124      124           
=====================================================
  Hits                        657      657           
  Misses                      224      224           
  Partials                     24       24           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 23 to 25
import { Folder, foldersSelector } from 'controllers/testCase';
import { useImportTestCase } from './useImportTestCase';

Choose a reason for hiding this comment

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

Suggested change
import { Folder, foldersSelector } from 'controllers/testCase';
import { useImportTestCase } from './useImportTestCase';
import { Folder, foldersSelector } from 'controllers/testCase';
import { useImportTestCase } from './useImportTestCase';

dispatch(hideModalAction());
};

const setTargetAndForm = (next: 'root' | 'existing') => {

Choose a reason for hiding this comment

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

Let's create type for 'root' | 'existing' union and use here and in useState above

useEffect(() => {
change('importTarget', target);

if (folderIdFromUrl && existingOptions.some((o) => Number(o.value) === folderIdFromUrl)) {

Choose a reason for hiding this comment

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

Suggested change
if (folderIdFromUrl && existingOptions.some((o) => Number(o.value) === folderIdFromUrl)) {
if (folderIdFromUrl && existingOptions.some((option) => Number(option.value) === folderIdFromUrl)) {

Choose a reason for hiding this comment

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

Suggested change
if (folderIdFromUrl && existingOptions.some((o) => Number(o.value) === folderIdFromUrl)) {
if (folderIdFromUrl && existingOptions.some(({ value }) => Number(value) === folderIdFromUrl)) {


const isWithinSize = (file: File) => file.size <= MAX_FILE_SIZE_BYTES;

const hasExistingOptions = existingOptions.length > 0;

Choose a reason for hiding this comment

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

Suggested change
const hasExistingOptions = existingOptions.length > 0;
const hasExistingOptions = !isEmpty(existingOptions);

} from 'controllers/testCase/actionCreators';
import { getTestCaseRequestParams } from 'pages/inside/testCaseLibraryPage/utils';
import { testCasesPageSelector } from 'controllers/testCase';
import { useCallback } from 'react';

Choose a reason for hiding this comment

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

Order of imports

&__segmented {
display: flex;
gap: 4px;
background: $COLOR--bg-200;

Choose a reason for hiding this comment

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

Suggested change
background: $COLOR--bg-200;
background: var(--rp-ui-base-bg-200);

}: InjectedFormProps<ImportTestCaseFormValues, ImportModalData> & ImportModalData) => {
const { formatMessage } = useIntl();
const [file, setFile] = useState<File | null>(null);
const [folderIdFromUrl] = useState<number | undefined>(() =>

Choose a reason for hiding this comment

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

Why do not we have set action here?

if (importTarget === 'existing') {
const resolvedId = existingFolderId ?? folderIdFromUrl;

if (!file || resolvedId == null) return;

Choose a reason for hiding this comment

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

Could you please add an empty line after if here and below.

Comment on lines 291 to 294
className={cx(
'import-test-case-modal__segmented-btn',
target === 'root' && 'is-active',
)}

Choose a reason for hiding this comment

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

Suggested change
className={cx(
'import-test-case-modal__segmented-btn',
target === 'root' && 'is-active',
)}
className={cx('import-test-case-modal__segmented-btn', {
'is-active': target === 'root'
})}

Also you can create const isRootTarget and reuse it here and for target === 'existing' as !isRootTarget.

folderName: commonValidators.requiredField(folderName),
}),
initialValues: { folderName: DEFAULT_FOLDER_NAME, importTarget: undefined },
validate: (values): FormErrors<ImportTestCaseFormValues> => {

Choose a reason for hiding this comment

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

Suggested change
validate: (values): FormErrors<ImportTestCaseFormValues> => {
validate: ({ importTarget, folderName }): FormErrors<ImportTestCaseFormValues> => {

defaultMessage: 'File size should be up to {size} MB',
},
specifyLocation: {
id: 'import.specifyLocation',
Copy link

@OleksandrDragun OleksandrDragun Nov 24, 2025

Choose a reason for hiding this comment

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

Suggested change
id: 'import.specifyLocation',
id: 'ImportTestCaseModal.specifyLocation',

And below. Could you please use the full path in the id as a key (not just createRoot but createNewRootFolder)

@ViktorSoroka07
Copy link

Please add visuals

@DmytroChebakov2191 DmytroChebakov2191 force-pushed the feature/import-modal-destination-folder-selection branch from 517a536 to c5bf0c5 Compare November 28, 2025 15:57
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants