Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Created December 3, 2022 06:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ksakae1216/21448b95db2946d5948306ed051e881b to your computer and use it in GitHub Desktop.
it('should call SampleContainerComponent.submitAction()', () => {
jest.spyOn(container, 'submitAction');
// 子Componentのemit
(fixture.debugElement.query(By.directive(SampleComponent)).componentInstance as SampleComponent).submitAction.emit();
// 親Containerのmethodがcallされてるかテスト
expect(container.submitAction).toHaveBeenCalledWith();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment