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-10-24 22:53:53 +00:00
|
|
|
beforeEach(ngModule('client'));
|
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};
|
2019-10-24 22:53:53 +00:00
|
|
|
$httpBackend.when('PATCH', `Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated}).respond('done');
|
|
|
|
$httpBackend.expectPATCH(`Clients/${controller.client.id}/addressesPropagateRe`, {isEqualizated: controller.client.isEqualizated});
|
2019-10-30 15:57:14 +00:00
|
|
|
controller.returnDialogEt('accept');
|
2018-02-05 09:58:49 +00:00
|
|
|
$httpBackend.flush();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|