2018-05-23 12:26:51 +00:00
|
|
|
import './index';
|
2018-02-05 09:58:49 +00:00
|
|
|
|
|
|
|
describe('Client', () => {
|
|
|
|
describe('Component vnClientFiscalData', () => {
|
|
|
|
let $httpBackend;
|
|
|
|
let $scope;
|
|
|
|
let controller;
|
|
|
|
|
2019-09-13 14:09:14 +00:00
|
|
|
beforeEach(angular.mock.module('client', $translateProvider => {
|
|
|
|
$translateProvider.translations('en', {});
|
|
|
|
}));
|
2018-02-05 09:58:49 +00:00
|
|
|
|
2018-12-22 10:59:26 +00:00
|
|
|
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_) => {
|
2018-02-05 09:58:49 +00:00
|
|
|
$httpBackend = _$httpBackend_;
|
|
|
|
$scope = $rootScope.$new();
|
2018-12-22 10:59:26 +00:00
|
|
|
controller = $componentController('vnClientFiscalData', {$scope});
|
2018-07-03 09:13:33 +00:00
|
|
|
controller.card = {reload: () => {}};
|
2018-02-05 09:58:49 +00:00
|
|
|
}));
|
|
|
|
|
|
|
|
describe('returnDialogEt()', () => {
|
|
|
|
it('should request to patch the propagation of tax status', () => {
|
|
|
|
controller.client = {id: 123, isEqualizated: false};
|
|
|
|
$httpBackend.when('PATCH', `/client/api/Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated}).respond('done');
|
|
|
|
$httpBackend.expectPATCH(`/client/api/Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated});
|
|
|
|
controller.returnDialogEt('ACCEPT');
|
|
|
|
$httpBackend.flush();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|