Skip to content

Instantly share code, notes, and snippets.

@alecklandgraf
Last active July 6, 2016 16:37
Show Gist options
  • Save alecklandgraf/200eb6ca7f3ba5dca1eaa094be5d6724 to your computer and use it in GitHub Desktop.
Save alecklandgraf/200eb6ca7f3ba5dca1eaa094be5d6724 to your computer and use it in GitHub Desktop.
hello component test with component
describe("hello nav component", function(){
// globals set up and used in each test scenario
var $componentController;
beforeEach(module('app'));
beforeEach(inject(function(_$componentController_) {
$componentController = _$componentController_;
}));
it('should bind its data to me on the controller', function () {
var me = {first_name: 'Aleck', last_name: 'Landgraf'};
var ctrl = $componentController('helloNav', null, {me: me});
expect(ctrl.me).toBeDefined();
expect(ctrl.me.first_name).toBe('Aleck');
expect(ctrl.me.last_name).toBe('Landgraf');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment