Skip to content

Commit 0dfddd2

Browse files
refactor: TTL-887 improve tests
1 parent 2c9a164 commit 0dfddd2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/app/modules/shared/components/details-fields/details-fields.component.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -744,14 +744,13 @@ describe('DetailsFieldsComponent', () => {
744744

745745
component.onSubmit();
746746
expect(toastrServiceStub.warning).not.toHaveBeenCalled();
747-
748747
expect(component.saveEntry.emit).toHaveBeenCalled();
749748
});
750749

751750
it('should not display a warning message when trying to save time entry of external customer without required fields and save', () => {
752751
component.entryForm.setValue({ ...entryWithoutRequiredFields, project_name: 'Warby Parker' });
753-
spyOn(toastrServiceStub, 'warning');
754752
spyOn(component.saveEntry, 'emit');
753+
spyOn(toastrServiceStub, 'warning');
755754

756755
component.onSubmit();
757756
expect(toastrServiceStub.warning).not.toHaveBeenCalled();
@@ -761,20 +760,17 @@ describe('DetailsFieldsComponent', () => {
761760

762761
it('should not display a warning message when trying to save time entry of internal app with description and save', () => {
763762
component.entryForm.setValue({ ...entryWithoutRequiredFields, description: 'Description' });
764-
765-
spyOn(toastrServiceStub, 'warning');
766763
spyOn(component.saveEntry, 'emit');
764+
spyOn(toastrServiceStub, 'warning');
767765

768766
component.onSubmit();
769767
expect(toastrServiceStub.warning).not.toHaveBeenCalled();
770-
771768
expect(component.saveEntry.emit).toHaveBeenCalled();
772769
});
773770

774771
/* We allow saving time entries with empty fields in uri and description for safari books and english lessons */
775772
it('should not display a warning message when trying to save time entry of English Lessons without description and save', () => {
776773
component.entryForm.setValue({ ...entryWithoutRequiredFields, project_name: 'ioet inc. - English Lessons' });
777-
778774
spyOn(toastrServiceStub, 'warning');
779775
spyOn(component.saveEntry, 'emit');
780776

@@ -784,7 +780,6 @@ describe('DetailsFieldsComponent', () => {
784780
expect(component.saveEntry.emit).toHaveBeenCalled();
785781
});
786782

787-
788783
/*
789784
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,
790785
and now these couple of tests are failing. A solution to this error might be generate a Test Wrapper Component. More details here:

0 commit comments

Comments
 (0)