///** // * @ngdoc function KontaktCtrl // * @name fasit.component.#example // * @function KontaktCtrl // * // * @description KontaktCtrl test // * desc // * // */ //describe('KontaktCtrl', function () { // var $scope: fb.IKontaktScope; // var ctrl; // var personService: fb.IMockPersonService; // var domainService: fb.IMockDomainService; // var personIntressentService: fb.IMockPersonIntressentService; // var personVisningarService: fb.IMockPersonVisningarService; // var personBudgivningarService: fb.IMockPersonBudgivningarService; // var commonService: fb.IMockCommonService; // var personAktiviteterService: fb.IMockPersonAktiviteterService; // var navigationService: fb.INavigationService; // var taggService: fb.ITaggService; // var sideDrawerService: fb.ISideDrawerService; // var haendelseService: fb.IMockHaendelseService; // var $filter: any; // var gotPerson: any; // var routeParams: any; // beforeEach(function () { // angular.mock.module('fasit', 'fbMocks', 'configModelMock'); // inject(function ($injector, $rootScope, $controller, getPersonTypFysisk, $routeParams, $filter,$location) {//, getKontakt) { // $scope = $rootScope.$new(); // routeParams = $routeParams; // gotPerson = getPersonTypFysisk; // personService = $injector.get('personService'); // domainService = $injector.get('domainService'); // personIntressentService = $injector.get('personIntressentService'); // personVisningarService = $injector.get('personVisningarService'); // personBudgivningarService = $injector.get('personBudgivningarService'); // haendelseService = $injector.get('haendelseService'); // commonService = $injector.get('commonService'); // personAktiviteterService = $injector.get('personAktiviteterService'); // navigationService = $injector.get('navigationService'); // taggService = $injector.get('taggService'); // sideDrawerService = $injector.get('sideDrawerService'); // routeParams.personId = '1498'; // ($scope).$$routeInit = true; // ctrl = $controller('KontaktCtrl', { // $scope: $scope, // $routeParams: routeParams, // personService: personService, // domainService: domainService, // personIntressentService: personIntressentService, // personVisningarService: personVisningarService, // personBudgivningarService: personBudgivningarService, // haendelseService: haendelseService, // commonService: commonService, // personAktiviteterService: personAktiviteterService, // $filter: $filter, // $rootScope: $rootScope, // $location: $location, // navigationService: navigationService, // taggService: taggService, // sideDrawerService: sideDrawerService // }); // $scope.$digest(); // $scope.kontaktData.$promise.then(function () { // spyOn($scope.kontakt, 'setValue').and.callFake(function (track, value) { // track.value = value; // track.dirty = true; // }); // }); // }); // }); // describe('vid initiering', function () { // it('borde förvänta sig att det finns ett KontaktCtrl', inject(function () { // expect(ctrl).not.toBeUndefined(); // })); // //describe('KontaktInformation funktionen', function () { // // it('ShowPersondetalj', function () { // // expect($scope.showPersondetalj.visa('epost')).toBe(false); // // }); // //}); // }); // describe('Fysisk person: Efter initiering', function () { // beforeEach(inject(function (getPersonTypFysisk) { // personService.resolve(fb.RequestType.GET, 1498 + '', getPersonTypFysisk); // $scope.$digest(); // })); // it('init', function () { // expect($scope.kontakt.Personnummer.value).toBe('19510303-4871'); // $scope.$digest(); // $scope.$digest(); // //expect(personIntressentService.getPendingRequests().length).toBe(1); // }); // describe('Helperfunctions', function () { // it('close', function () { // spyOn(navigationService, 'closeWoNavigationObjekt'); // $scope.close(); // expect(navigationService.closeWoNavigationObjekt).toHaveBeenCalled(); // }); // }); // }); // describe('Juridisk person: Efter initiering', function () { // beforeEach(inject(function (getPersonTypJuridiskBRF) { // personService.resolve(fb.RequestType.GET, 1498 + '', getPersonTypJuridiskBRF); // $scope.$digest(); // })); // describe('Helperfunctions', function () { // it('addPersonKategori', function () { // var person = $scope.kontakt; // spyOn(person, 'enqueue'); // expect(person.PersonKategorier.length).toBe(1); // $scope.addPersonKategori(1); // expect(person.PersonKategorier.length).toBe(2); // $scope.addPersonKategori(3); // expect(person.PersonKategorier.length).toBe(3); // $scope.addPersonKategori(1); // expect(person.PersonKategorier.length).toBe(3); // var spy = person.enqueue; // expect(spy.calls.count()).toBe(2); // }); // it('removePersonKategori', function () { // var person = $scope.kontakt; // spyOn(person, 'enqueue'); // person.PersonKategorier.push(new fb.ChangeTrack(1), new fb.ChangeTrack(2)); // expect(person.PersonKategorier.length).toBe(3); // $scope.removePersonKategori(2); // expect(person.PersonKategorier.length).toBe(2); // $scope.removePersonKategori(3); // expect(person.PersonKategorier.length).toBe(2); // $scope.removePersonKategori(1); // expect(person.PersonKategorier.length).toBe(1); // var spy = person.enqueue; // expect(spy.calls.count()).toBe(2); // }); // }); // }); //});