salix/modules/client/front/fiscal-data/index.spec.js

31 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-05-23 12:26:51 +00:00
import './index';
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', {});
}));
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();
});
});
});
});