-
Notifications
You must be signed in to change notification settings - Fork 1
fix: TT-25 Empty selection in Activity drop-down(Time Clock page) #686
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
fix: TT-25 Empty selection in Activity drop-down(Time Clock page) #686
Conversation
Codecov Report
@@ Coverage Diff @@
## master #686 +/- ##
==========================================
+ Coverage 93.09% 94.28% +1.19%
==========================================
Files 85 103 +18
Lines 1564 2031 +467
Branches 107 146 +39
==========================================
+ Hits 1456 1915 +459
- Misses 67 76 +9
+ Partials 41 40 -1
Continue to review full report at Codecov.
|
|
|
||
| it('toastrService should be called when the activity field is empty', () => { | ||
| fixture.detectChanges(); | ||
| const select: HTMLSelectElement = fixture.debugElement.query(By.css('select')).nativeElement; |
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.
add a line white after this line
| } | ||
|
|
||
| onSubmit() { | ||
| if (this.entryForm.value.activity_id === '-1') { |
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.
The empty option has an id -1 ?
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.
Yes, it was done in an old PR to solve another problem: https://github.com/ioet/time-tracker-ui/blob/10e7694a56bd6cca2df98664d54175bdfa293f86/src/app/modules/time-clock/components/entry-fields/entry-fields.component.html
| const select: HTMLSelectElement = fixture.debugElement.query(By.css('select')).nativeElement; | ||
| spyOn(toastrServiceStub, 'error'); | ||
| select.value = select.options[0].value; | ||
| select.dispatchEvent(new Event('change')); |
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.
add a line white after this line
|
Kudos, SonarCloud Quality Gate passed! |
Hi Team, I solved the problem by checking if the activity is not empty in the onSubmit() method.