Skip to content

Commit 1b03641

Browse files
committed
Implementing form status before doing submit
1 parent 0a25087 commit 1b03641

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/app/modules/reports/components/time-range-form/time-range.component.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ describe('Reports Page', () => {
115115
expect(component.onSubmit).toHaveBeenCalled();
116116
});
117117

118+
it('triggers onSubmit with the form status valid', () => {
119+
spyOn(component, 'onSubmit');
120+
let valid = component.reportForm.valid;
121+
component.setInitialDataOnScreen();
122+
123+
expect(valid).toBeTruthy();
124+
expect(component.onSubmit).toHaveBeenCalled();
125+
});
126+
118127
it('When the ngOnChanges method is called, the onSubmit method is called', () => {
119128
const userId = 'abcd';
120129
spyOn(component, 'onSubmit');

0 commit comments

Comments
 (0)