import './index'; describe('component vnShelvingCard', () => { let controller; let $httpBackend; const data = {id: 1, code: 'AAA'}; beforeEach(ngModule('shelving')); beforeEach(inject(($componentController, _$httpBackend_, $stateParams) => { $httpBackend = _$httpBackend_; let $element = angular.element('
'); controller = $componentController('vnShelvingCard', {$element}); $stateParams.id = data.id; $httpBackend.whenRoute('GET', 'Shelvings/:id').respond(data); })); it('should reload the controller data', () => { controller.reload(); $httpBackend.flush(); expect(controller.shelving).toEqual(data); }); });