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 test when the ngOnChanges method is the first change, th…
…e onSubmit method id not called
  • Loading branch information
sbateca committed May 25, 2022
commit 385a8ae30ff1a57eb8ab9d16deee9504fbdcde35
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,15 @@ describe('Reports Page', () => {
expect(component.onSubmit).toHaveBeenCalled();
});

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

component.ngOnChanges({userId: new SimpleChange(null, userId, true)});

expect(component.onSubmit).not.toHaveBeenCalled();
});

afterEach(() => {
fixture.destroy();
});
Expand Down