Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: TT-25 Delete the '-1' option from the html file
  • Loading branch information
lenshinoda committed May 17, 2021
commit 69263bcfacaa4f27579f062e2169527d51b09317
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
(change)="onSubmit()"
class="form-control"
formControlName="activity_id"
[class.is-invalid]="activity_id.invalid && activity_id.touched || activity_id.value == '-1'"
[class.is-invalid]="activity_id.invalid && activity_id.touched"
required>
<option value="-1"></option>
<option *ngFor="let activity of activities" value="{{ activity.id }}">{{ activity.name }}</option>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ 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', () => {
Expand Down Expand Up @@ -467,15 +466,6 @@ 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
Expand Up @@ -133,10 +133,6 @@ 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 }));
}

Expand Down