Unit Testing Angular Components with $componentController
Angular 1.5+’s components are great, but testing them properly requires some changes to they way you were used to testing before.
Directives were always a bit clunky to test in Angular. You would either have to deal with recreating their DOM elements, or exposing the controller outside of the directive in order to test it directly. Since components are essentially wrappers around directives, you might expect the same dance.
But, along the introduction of components we also got the handy $componentController service.