-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ import { DATE_FORMAT_YEAR } from 'src/environments/environment'; | |
| import { FeatureManagerService } from './../../../shared/feature-toggles/feature-toggle-manager.service'; | ||
| import { FeatureToggleGeneralService } from './../../../shared/feature-toggles/feature-toggle-general/feature-toggle-general.service'; | ||
| import { FeatureToggle } from 'src/environments/enum'; | ||
| import { By } from '@angular/platform-browser'; | ||
|
|
||
|
|
||
| describe('EntryFieldsComponent', () => { | ||
|
|
@@ -466,6 +467,15 @@ describe('EntryFieldsComponent', () => { | |
| expect(featureToggleGeneralService.isActivated).toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
|
|
||
| it('toastrService should be called when the activity field is empty', () => { | ||
| fixture.detectChanges(); | ||
| const select: HTMLSelectElement = fixture.debugElement.query(By.css('select')).nativeElement; | ||
| spyOn(toastrServiceStub, 'error'); | ||
| select.value = select.options[0].value; | ||
| select.dispatchEvent(new Event('change')); | ||
|
||
| expect(toastrServiceStub.error).toHaveBeenCalled(); | ||
| }); | ||
| }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,10 @@ export class EntryFieldsComponent implements OnInit, OnDestroy { | |
| } | ||
|
|
||
| onSubmit() { | ||
| if (this.entryForm.value.activity_id === '-1') { | ||
|
||
| this.toastrService.error('Please enter a valid activity'); | ||
| return; | ||
| } | ||
| this.store.dispatch(new entryActions.UpdateEntryRunning({ ...this.newData, ...this.entryForm.value })); | ||
| } | ||
|
|
||
|
|
||
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