Skip to content

Commit

Permalink
Merge pull request #1518 from eciis/fix-institution-controller-spec
Browse files Browse the repository at this point in the history
Fix InstitutionControllerSpec
  • Loading branch information
JuliePessoa authored Mar 11, 2019
2 parents 0286b21 + 8283583 commit 3f3a85a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion frontend/test/specs/institution/institutionControllerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,23 @@
expect(institutionService.update).toHaveBeenCalled();
});
});

describe('goToEvents', function() {
it('should call state.go with the right params', function(){
it('should call state.go with the INST_EVENTS on desktop', function(){
spyOn(utilsService, 'selectNavOption');
spyOn(Utils, 'isMobileScreen').and.returnValue(false);
institutionCtrl.goToEvents(first_institution.key);
expect(utilsService.selectNavOption).toHaveBeenCalledWith(
states.INST_EVENTS,
{
institutionKey: first_institution.key,
}
);
});

it('should call state.go with the EVENTS on mobile', function(){
spyOn(utilsService, 'selectNavOption');
spyOn(Utils, 'isMobileScreen').and.returnValue(true);
institutionCtrl.goToEvents(first_institution.key);
expect(utilsService.selectNavOption).toHaveBeenCalledWith(
states.EVENTS,
Expand All @@ -267,6 +281,7 @@
);
});
});

describe('goToLinks()', function() {
it('should call state.go', function() {
spyOn(state, 'go');
Expand Down

0 comments on commit 3f3a85a

Please sign in to comment.