Skip to content

Conversation

@lenshinoda
Copy link
Collaborator

Hi Team, I solved the problem by checking if the activity is not empty in the onSubmit() method.

@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #686 (69263bc) into master (13de42e) will increase coverage by 1.19%.
The diff coverage is 94.58%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
...nents/time-range-form/time-range-form.component.ts 100.00% <ø> (ø)
...er-management/store/customer-management.effects.ts 83.78% <14.28%> (-16.22%) ⬇️
...ared/components/input-date/input-date.component.ts 64.28% <50.00%> (-4.95%) ⬇️
...time-entries-table/time-entries-table.component.ts 61.90% <60.00%> (+6.34%) ⬆️
src/app/modules/user/store/user.reducer.ts 62.50% <62.50%> (ø)
src/app/modules/user/services/user-info.service.ts 66.66% <66.66%> (ø)
src/app/modules/user/services/user.service.ts 75.00% <75.00%> (ø)
.../components/project-list/project-list.component.ts 85.18% <81.81%> (+0.97%) ⬆️
...dules/time-entries/pages/time-entries.component.ts 85.33% <82.60%> (+2.52%) ⬆️
...es-management/store/activity-management.effects.ts 94.59% <83.33%> (-5.41%) ⬇️
... and 77 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f239ab1...69263bc. Read the comment docs.


it('toastrService should be called when the activity field is empty', () => {
fixture.detectChanges();
const select: HTMLSelectElement = fixture.debugElement.query(By.css('select')).nativeElement;
Copy link
Collaborator

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') {
Copy link
Collaborator

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 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

const select: HTMLSelectElement = fixture.debugElement.query(By.css('select')).nativeElement;
spyOn(toastrServiceStub, 'error');
select.value = select.options[0].value;
select.dispatchEvent(new Event('change'));
Copy link
Collaborator

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@scastillo-jp scastillo-jp merged commit 7f74b46 into master May 18, 2021
@scastillo-jp scastillo-jp deleted the TT-25-Empty-selection-in-Activity-drop-down-Time-Clock-page branch May 18, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants