31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import './index';
|
|
|
|
describe('Client', () => {
|
|
describe('Component vnClientFiscalData', () => {
|
|
let $httpBackend;
|
|
let $scope;
|
|
let controller;
|
|
|
|
beforeEach(angular.mock.module('client', $translateProvider => {
|
|
$translateProvider.translations('en', {});
|
|
}));
|
|
|
|
beforeEach(angular.mock.inject(($componentController, $rootScope, _$httpBackend_) => {
|
|
$httpBackend = _$httpBackend_;
|
|
$scope = $rootScope.$new();
|
|
controller = $componentController('vnClientFiscalData', {$scope});
|
|
controller.card = {reload: () => {}};
|
|
}));
|
|
|
|
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();
|
|
});
|
|
});
|
|
});
|
|
});
|