import './index'; describe('component vnRoleCard', () => { let controller; let $httpBackend; beforeEach(ngModule('account')); beforeEach(inject(($componentController, _$httpBackend_) => { $httpBackend = _$httpBackend_; controller = $componentController('vnRoleCard', {$element: null}); })); describe('reload()', () => { it('should reload the controller data', () => { controller.$params.id = 1; $httpBackend.expectGET('Roles/1').respond('foo'); controller.reload(); $httpBackend.flush(); expect(controller.role).toBe('foo'); }); }); });