Skip to content

1050-fix: Fix undefined subtitle for angular course in course card - #1061

Merged
ansivgit merged 5 commits into
mainfrom
fix/1050-undefined-subtitle-for-angular-course-in-course-card
Mar 13, 2026
Merged

1050-fix: Fix undefined subtitle for angular course in course card#1061
ansivgit merged 5 commits into
mainfrom
fix/1050-undefined-subtitle-for-angular-course-in-course-card

Conversation

@TeymurDev

@TeymurDev TeymurDev commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this? (select all that apply)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 🚧 Breaking Change
  • 🧑‍💻 Code Refactor
  • 📝 Documentation Update

Description

Related Tickets & Documents

Screenshots, Recordings

Please replace this line with any relevant images for UI changes.

Added/updated tests?

  • 👌 Yes
  • 🙅‍♂️ No, because they aren't needed
  • 🙋‍♂️ No, because I need help

[optional] Are there any post deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Summary by CodeRabbit

  • Bug Fixes
    • Course card titles now append subtitles in parentheses only when a subtitle exists; empty subtitle indicators no longer appear.
  • Tests
    • Updated test cases to reflect and validate the new subtitle-in-title behavior consistently.

@github-actions github-actions Bot changed the title Fix/1050 undefined subtitle for angular course in course card 1050-fix: Undefined subtitle for angular course in course card Mar 9, 2026
@TeymurDev TeymurDev changed the title 1050-fix: Undefined subtitle for angular course in course card 1050-fix: Fix undefined subtitle for angular course in course card Mar 9, 2026
@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 34a03532-85cf-4986-ae1c-4c53de9c4749

📥 Commits

Reviewing files that changed from the base of the PR and between 2404258 and 0bf1295.

📒 Files selected for processing (2)
  • src/entities/course/ui/course-card/course-card.test.tsx
  • src/widgets/external-embed-content/ui/courses/courses.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/entities/course/ui/course-card/course-card.test.tsx

📝 Walkthrough

Walkthrough

Removed Angular-specific title special-case in CourseCard; made subTitle default to empty and append (subTitle) only when !showMentoringStartDate and subTitle is truthy. Updated tests to match the new title construction.

Changes

Cohort / File(s) Summary
Course Card Component
src/entities/course/ui/course-card/course-card.tsx, src/entities/course/ui/course-card/course-card.test.tsx
Removed COURSE_TITLES import/special-case; added subTitle = '' default prop and changed title mark logic to !showMentoringStartDate && subTitle ? \ (${subTitle})` : ''`. Tests updated accordingly.
Courses Widget Tests
src/widgets/external-embed-content/ui/courses/courses.test.tsx
Test expectations updated to append (subTitle) when c.subTitle exists and c.showMentoringStartDate is falsy, removing Angular-specific checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels

bug

Suggested reviewers

  • dzmitry-varabei
  • andron13
  • ansivgit
  • natanchik
  • Quiddlee
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description follows the template with bug fix type selected and related issue linked, but the Description section is empty and test status is not explicitly confirmed. Add a brief description explaining what was changed and why, and clarify whether tests were added or modified to validate the fix.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main fix: removing hardcoded ANGULAR course special-casing and generalizing subtitle handling in the course card component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/1050-undefined-subtitle-for-angular-course-in-course-card
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can get early access to new features in CodeRabbit.

Enable the early_access setting to enable early access features such as new models, tools, and more.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/entities/course/ui/course-card/course-card.test.tsx (1)

24-26: Add an explicit regression case for missing Angular subtitles.

This expectation rebuilds the same condition as the component, so it doesn't clearly prove the subTitle: undefined bug is fixed. A dedicated test with Angular + subTitle={undefined} would make the regression coverage much stronger.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/entities/course/ui/course-card/course-card.test.tsx` around lines 24 -
26, The test currently reconstructs the component logic using the mark/title
computation (variables mark and title) and doesn't explicitly assert the
regression where Angular courses may have subTitle undefined; add a dedicated
unit test in course-card.test.tsx that renders the CourseCard (or the component
under test) with course.title === COURSE_TITLES.ANGULAR and course.subTitle set
to undefined, then assert the rendered output does not include a subtitle
parenthesis and matches the expected title string without the subtitle;
reference the COURSE_TITLES.ANGULAR constant and the course.subTitle prop to
locate where to add this regression case.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/entities/course/ui/course-card/course-card.test.tsx`:
- Around line 24-26: The test currently reconstructs the component logic using
the mark/title computation (variables mark and title) and doesn't explicitly
assert the regression where Angular courses may have subTitle undefined; add a
dedicated unit test in course-card.test.tsx that renders the CourseCard (or the
component under test) with course.title === COURSE_TITLES.ANGULAR and
course.subTitle set to undefined, then assert the rendered output does not
include a subtitle parenthesis and matches the expected title string without the
subtitle; reference the COURSE_TITLES.ANGULAR constant and the course.subTitle
prop to locate where to add this regression case.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 761f377a-cd46-463d-a59d-94c320773770

📥 Commits

Reviewing files that changed from the base of the PR and between ec04620 and b8ccf61.

📒 Files selected for processing (3)
  • src/entities/course/ui/course-card/course-card.test.tsx
  • src/entities/course/ui/course-card/course-card.tsx
  • src/widgets/external-embed-content/ui/courses/courses.test.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/entities/course/ui/course-card/course-card.test.tsx`:
- Around line 23-26: The test builds the expected title using a non-existent
property course.showMentoringStartDate; remove that invalid access and derive
the mark solely from course.subTitle (i.e., const mark = course.subTitle ? `
(${course.subTitle})` : ''), then compute title as `${course.title}${mark}` so
the expectation matches the rendered <CourseCard {...course} /> without adding
showMentoringStartDate.

In `@src/widgets/external-embed-content/ui/courses/courses.test.tsx`:
- Around line 20-23: The test accesses a non-existent property
c.showMentoringStartDate on mockedCourses; update either the Course type
(src/entities/course/types.ts) to include showMentoringStartDate and add that
field to the mockedCourses test fixtures, or change the mark logic in
courses.test.tsx to rely only on existing properties (e.g., use c.subTitle
presence) and remove references to showMentoringStartDate so the comparison uses
`${c.title}${c.subTitle ? ` (${c.subTitle})` : ''}`; modify the Course type,
mockedCourses fixture, or the comparison in the test accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3a22705e-b9c7-4e74-b04c-70bcb50ff267

📥 Commits

Reviewing files that changed from the base of the PR and between b8ccf61 and 2404258.

📒 Files selected for processing (3)
  • src/entities/course/ui/course-card/course-card.test.tsx
  • src/entities/course/ui/course-card/course-card.tsx
  • src/widgets/external-embed-content/ui/courses/courses.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/entities/course/ui/course-card/course-card.tsx

Comment thread src/entities/course/ui/course-card/course-card.test.tsx Outdated
Comment thread src/widgets/external-embed-content/ui/courses/courses.test.tsx
@ansivgit
ansivgit merged commit 8fff12c into main Mar 13, 2026
3 checks passed
@ansivgit
ansivgit deleted the fix/1050-undefined-subtitle-for-angular-course-in-course-card branch March 13, 2026 13:48
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