Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Created December 3, 2022 06:51
Embed
What would you like to do?
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