Skip to content

Conversation

@Predixx
Copy link
Contributor

@Predixx Predixx commented Nov 24, 2025

Motivation and Context

This PR adds test coverage for the default case in the IrisLogoComponent.classList() method that was previously uncovered (line 44). The default branch returns an empty string when a custom numeric size is provided.

Description

  • Added a test case that verifies the classList() computed property returns an empty string when given a custom numeric size (e.g., 100) instead of one of the predefined IrisLogoSize enum values
  • This improves test coverage from 96% to 100% for the iris-logo.component.ts file

Steps for Testing

  1. Run the test suite for the IrisLogoComponent:
    npm run test:one -- iris-logo.component.spec
  2. Verify that all tests pass, including the new test case "should return empty string for custom numeric size"

Testserver States

Not applicable - this is a pure test addition with no functional changes.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

Not applicable - test-only change

Exam Mode Test

Not applicable - test-only change

Summary by CodeRabbit

  • Tests
    • Added test coverage for edge-case input handling in the component, verifying behavior when receiving non-standard numeric values.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Nov 24, 2025
@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) iris Pull requests that affect the corresponding module labels Nov 24, 2025
@Predixx Predixx changed the title Development: Add test for default case in Iris logo component Iris: Add test for default case in Iris logo component Nov 24, 2025
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ✅SkippedFailedTime ⏱
End-to-End (E2E) Test Report1 ran1 passed0 skipped0 failed1s 375ms
TestResultTime ⏱
No test annotations available

@Predixx Predixx marked this pull request as ready for review November 24, 2025 19:26
@Predixx Predixx requested a review from a team as a code owner November 24, 2025 19:26
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 24, 2025

Walkthrough

Added a unit test to IrisLogoComponent verifying that classList() returns an empty string when the component receives a numeric, non-enum size value (100). This test exercises edge-case input handling for the component's size property.

Changes

Cohort / File(s) Change Summary
Unit Test Addition
src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
Added new test case verifying classList() behavior when receiving numeric non-enum size input (size = 100) returns empty string

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a test for the default case in the Iris logo component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/iris/test-iris-logo-component

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts (1)

56-59: LGTM! Test effectively covers the default branch.

The test correctly verifies that classList() returns an empty string when provided with a custom numeric size value outside the IrisLogoSize enum. The test is well-structured, follows existing patterns, and achieves the stated coverage goal.

Optionally, consider testing additional edge cases (e.g., null, undefined, or string values) in future test improvements to further validate the robustness of the classList() method's default behavior.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 466bb2c and 6c3ee31.

📒 Files selected for processing (1)
  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/main/webapp/**/*.ts

⚙️ CodeRabbit configuration file

angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

Files:

  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
🧠 Learnings (6)
📓 Common learnings
Learnt from: SimonEntholzer
Repo: ls1intum/Artemis PR: 8929
File: src/test/java/de/tum/in/www1/artemis/authentication/UserLocalVcIntegrationTest.java:29-33
Timestamp: 2024-07-16T19:27:15.402Z
Learning: When addressing missing test coverage, ensure that new tests specifically validate the functionality introduced in the PR, such as token-based authentication.
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts:91-96
Timestamp: 2024-07-09T19:09:34.276Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting to change `expect(component.expandAll).toHaveBeenCalledOnce()` to `expect(component.expandAll).toHaveBeenCalledTimes(1)`.
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts:88-89
Timestamp: 2024-07-09T19:09:49.666Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting to change `expect(component.expandAll).toHaveBeenCalledOnce()` to `expect(component.expandAll).toHaveBeenCalledTimes(1)`.
Learnt from: alexjoham
Repo: ls1intum/Artemis PR: 9455
File: src/test/java/de/tum/cit/aet/artemis/iris/IrisTextExerciseChatMessageIntegrationTest.java:401-401
Timestamp: 2024-10-15T11:33:17.915Z
Learning: In the Artemis project, when new fields are added to classes like `PyrisChatStatusUpdateDTO`, corresponding tests may be implemented in separate integration test classes such as `IrisChatTokenTrackingIntegrationTest`.
📚 Learning: 2025-09-01T10:20:40.706Z
Learnt from: Michael-Breu-UIbk
Repo: ls1intum/Artemis PR: 10989
File: src/main/webapp/app/programming/manage/detail/programming-exercise-detail.component.with-sharing.spec.ts:132-149
Timestamp: 2025-09-01T10:20:40.706Z
Learning: In the Artemis codebase, Angular component test files for ProgrammingExerciseDetailComponent follow a pattern where the component is imported but not explicitly declared in TestBed.configureTestingModule(), yet TestBed.createComponent() still works successfully. This pattern is consistently used across test files like programming-exercise-detail.component.spec.ts and programming-exercise-detail.component.with-sharing.spec.ts.

Applied to files:

  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
📚 Learning: 2024-08-02T14:03:49.485Z
Learnt from: rabeatwork
Repo: ls1intum/Artemis PR: 9103
File: src/test/javascript/spec/component/shared/metis/postings-header/answer-post-header/answer-post-header.component.spec.ts:94-94
Timestamp: 2024-08-02T14:03:49.485Z
Learning: The `#today-flag` ID is only present in the test files and not in the actual component's HTML or TypeScript files.

Applied to files:

  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
📚 Learning: 2024-10-20T22:00:52.335Z
Learnt from: pzdr7
Repo: ls1intum/Artemis PR: 9505
File: src/test/javascript/spec/integration/code-editor/code-editor-container.integration.spec.ts:179-181
Timestamp: 2024-10-20T22:00:52.335Z
Learning: In `src/test/javascript/spec/integration/code-editor/code-editor-container.integration.spec.ts`, `ResizeObserver` is mocked within the `beforeEach` block.

Applied to files:

  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
📚 Learning: 2025-08-21T17:30:20.530Z
Learnt from: MoritzSpengler
Repo: ls1intum/Artemis PR: 11297
File: src/main/webapp/app/quiz/shared/questions/drag-and-drop-question/drag-and-drop-question.component.spec.ts:34-34
Timestamp: 2025-08-21T17:30:20.530Z
Learning: FitTextDirective in src/main/webapp/app/quiz/shared/fit-text/fit-text.directive.ts is a standalone directive marked with standalone: true, so it should be imported in TestBed imports array, not declarations array.

Applied to files:

  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
📚 Learning: 2024-07-09T19:09:49.666Z
Learnt from: florian-glombik
Repo: ls1intum/Artemis PR: 8858
File: src/test/javascript/spec/component/shared/sidebar/sidebar-accordion.component.spec.ts:88-89
Timestamp: 2024-07-09T19:09:49.666Z
Learning: For the PR ls1intum/Artemis#8858, avoid suggesting to change `expect(component.expandAll).toHaveBeenCalledOnce()` to `expect(component.expandAll).toHaveBeenCalledTimes(1)`.

Applied to files:

  • src/main/webapp/app/iris/overview/iris-logo/iris-logo.component.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis

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

Labels

client Pull requests that update TypeScript code. (Added Automatically!) iris Pull requests that affect the corresponding module ready for review

Projects

Status: Work In Progress

Development

Successfully merging this pull request may close these issues.

2 participants