-
Notifications
You must be signed in to change notification settings - Fork 297
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
Lectures
: Replace guided mode with status bar edit and create view
#9655
base: develop
Are you sure you want to change the base?
Conversation
… call in template
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.
Code 👍
Change requests are addressed
...webapp/app/lecture/lecture-unit/lecture-unit-management/lecture-unit-management.component.ts
Outdated
Show resolved
Hide resolved
fb261b8
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: 0
🧹 Nitpick comments (1)
src/test/javascript/spec/util/regex.util.spec.ts (1)
28-33
: Validation of regex boundaries and anchors.
These scenarios confirm the function’s behavior with start and end anchors, vital for avoiding partial matches.A possible extension might be to test empty strings or invalid regex patterns to confirm the function’s handling of edge cases.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/test/javascript/spec/component/shared/image-cropper/keyboard.util.spec.ts
(1 hunks)src/test/javascript/spec/util/regex.util.spec.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/test/javascript/spec/util/regex.util.spec.ts (1)
Pattern src/test/javascript/spec/**/*.ts
: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}
src/test/javascript/spec/component/shared/image-cropper/keyboard.util.spec.ts (1)
Pattern src/test/javascript/spec/**/*.ts
: jest: true; mock: NgMocks; bad_practices: avoid_full_module_import; perf_improvements: mock_irrelevant_deps; service_testing: mock_http_for_logic; no_schema: avoid_NO_ERRORS_SCHEMA; expectation_specificity: true; solutions: {boolean: toBeTrue/False, reference: toBe, existence: toBeNull/NotNull, undefined: toBeUndefined, class_obj: toContainEntries/toEqual, spy_calls: {not_called: not.toHaveBeenCalled, once: toHaveBeenCalledOnce, with_value: toHaveBeenCalledWith|toHaveBeenCalledExactlyOnceWith}}
🔇 Additional comments (12)
src/test/javascript/spec/component/shared/image-cropper/keyboard.util.spec.ts (4)
1-2
: Great job keeping the imports minimal.
Since this file focuses on testing utility functions, importing only the needed methods keeps it clean and aligned with the guidance to avoid full-module imports.
4-24
: Tests for getPositionForKey are comprehensive and consistent.
All arrow keys and the default key are tested individually, and the usage of “.toBe” for string comparisons is clear and correct. This ensures maximum coverage and specificity in each scenario.
26-46
: Inverted position checks are correctly validated.
Similar to the first suite, you’ve tested each arrow key thoroughly, with proper default handling. The test naming is clear and matches the method’s intent.
48-70
: Robust coverage for getEventForKey.
The tests handle all arrow keys plus an unknown key with correct clientX/clientY expectations. Using “.toEqual” for object comparisons is appropriate. The stepSize parameter further clarifies the function’s behavior for typical keyboard events.
src/test/javascript/spec/util/regex.util.spec.ts (8)
1-2
: Import statement is concise and appropriate.
The import aligns with the test usage, and the function under test is correctly referenced.
3-3
: Descriptive test suite name.
Using a suite name that matches the function helps keep tests organized and clear.
4-6
: Comprehensive edge case test.
Testing behavior when the regex is undefined ensures robust handling of optional or missing parameters.
8-10
: Good negative test scenario.
Validates behavior when the input string is undefined, covering potential null-like inputs.
12-14
: Complete match scenario well-tested.
Ensures the function behaves correctly when there's an exact match, confirming no partial or extra characters are accepted.
16-18
: Verifies partial match handling.
Appropriately confirms a false return on partial matches, preventing false positives.
20-22
: Test for special characters is important.
Ensures that regex operators work as intended in real-world usage.
24-26
: Confirmation of zero-match logic.
Helpful to confirm that a completely disjoint pattern appropriately returns false.
Checklist
General
Client
Motivation and Context
We do currently have the guided mode for the creation of lectures, however, we consider the approach used for the creation of exercises (status bar that allows you to scroll to sections and displays the current state of these sections) as more user friendly than the current guided mode.
Description
Steps for Testing
Prerequisites:
title
andperiod
section are offeredattachments
andunits
sections are availableattachments
andunits
sectionsave
button is enabled if there is a change made totitle
orperiod
section (attachment
/unit
section changes are saved directly)Testserver States
Note
These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.
Review Progress
Performance Review
Code Review
Manual Tests
Test Coverage
Screenshots
new version (status bar instead of guided mode)
old version
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Refactor
Attachment
class by removing an empty constructor to simplify the class definition.Chores