ngUpgraders / ng-forward

The default solution for those that want to write Angular 2.x style code in Angular 1.x
411 stars 36 forks source link

Required a way to test the component with Input and Output #151

Closed erashu212 closed 8 years ago

erashu212 commented 8 years ago

Hi,

Can anybody please suggest how can I do a component testing with Input and Output in Mocha + Sinon + Chai.

Thanks, Ashutosh

timkindberg commented 8 years ago

See the docs: https://github.com/ngUpgraders/ng-forward/blob/master/API.md#testing

Also see: https://github.com/ngUpgraders/ng-forward-playground/blob/feat/tests/app/components/FilterLinks.spec.js

See how the test injects the controller via the componentInstance property? You can access your inputs and trigger your outputs via there.

erashu212 commented 8 years ago

Can you please provide some kind of snippet. Actually I am lost.