Skip to content
Closed
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
Next Next commit
Implementing form status before doing submit
  • Loading branch information
sbateca committed May 24, 2022
commit 1b03641b55e797b926a43efa8e38cf7cbd315783
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ describe('Reports Page', () => {
expect(component.onSubmit).toHaveBeenCalled();
});

it('triggers onSubmit with the form status valid', () => {
spyOn(component, 'onSubmit');
let valid = component.reportForm.valid;
component.setInitialDataOnScreen();

expect(valid).toBeTruthy();
expect(component.onSubmit).toHaveBeenCalled();
});

it('When the ngOnChanges method is called, the onSubmit method is called', () => {
const userId = 'abcd';
spyOn(component, 'onSubmit');
Expand Down