Merge pull request '3081-newbankentity_component_refactor' (#735) from 3081-newbankentity_component_refactor into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #735 Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
commit
d52252ac07
|
@ -186,9 +186,10 @@ export default {
|
||||||
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
|
receivedB2BVNLCheckbox: 'vn-client-billing-data vn-check[label="Received B2B VNL"]',
|
||||||
swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
|
swiftBic: 'vn-client-billing-data vn-autocomplete[ng-model="$ctrl.client.bankEntityFk"]',
|
||||||
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
|
newBankEntityButton: 'vn-client-billing-data vn-icon-button[vn-tooltip="New bank entity"] > button',
|
||||||
newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.name"]',
|
newBankEntityName: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.name"]',
|
||||||
newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.bic"]',
|
newBankEntityBIC: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.bic"]',
|
||||||
newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.newBankEntity.id"]',
|
newBankEntityCountry: '.vn-dialog.shown vn-autocomplete[ng-model="$ctrl.data.countryFk"]',
|
||||||
|
newBankEntityCode: '.vn-dialog.shown vn-textfield[ng-model="$ctrl.data.id"]',
|
||||||
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
|
acceptBankEntityButton: '.vn-dialog.shown button[response="accept"]',
|
||||||
saveButton: 'vn-client-billing-data button[type=submit]',
|
saveButton: 'vn-client-billing-data button[type=submit]',
|
||||||
watcher: 'vn-client-billing-data vn-watcher'
|
watcher: 'vn-client-billing-data vn-watcher'
|
||||||
|
|
|
@ -34,8 +34,9 @@ describe('Client Edit billing data path', () => {
|
||||||
it(`should create a new BIC code`, async() => {
|
it(`should create a new BIC code`, async() => {
|
||||||
await page.waitToClick(selectors.clientBillingData.newBankEntityButton);
|
await page.waitToClick(selectors.clientBillingData.newBankEntityButton);
|
||||||
await page.write(selectors.clientBillingData.newBankEntityName, 'Gotham City Bank');
|
await page.write(selectors.clientBillingData.newBankEntityName, 'Gotham City Bank');
|
||||||
await page.write(selectors.clientBillingData.newBankEntityCode, '9999');
|
|
||||||
await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT');
|
await page.write(selectors.clientBillingData.newBankEntityBIC, 'GTHMCT');
|
||||||
|
await page.autocompleteSearch(selectors.clientBillingData.newBankEntityCountry, 'España');
|
||||||
|
await page.write(selectors.clientBillingData.newBankEntityCode, '9999');
|
||||||
await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton);
|
await page.waitToClick(selectors.clientBillingData.acceptBankEntityButton);
|
||||||
await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'Gotham City Bank');
|
await page.waitForTextInField(selectors.clientBillingData.swiftBic, 'Gotham City Bank');
|
||||||
const newcode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
const newcode = await page.waitToGetProperty(selectors.clientBillingData.swiftBic, 'value');
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
<vn-dialog class="edit"
|
<tpl-title translate>
|
||||||
vn-id="bankEntityDialog"
|
New bank entity
|
||||||
on-open="$ctrl.resetData()"
|
</tpl-title>
|
||||||
on-accept="$ctrl.onAccept()"
|
<tpl-body>
|
||||||
message="New bank entity">
|
|
||||||
<tpl-body>
|
|
||||||
<p translate>Please, ensure you put the correct data!</p>
|
<p translate>Please, ensure you put the correct data!</p>
|
||||||
<vn-horizontal>
|
<vn-horizontal>
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
|
@ -14,8 +12,6 @@
|
||||||
ng-model="$ctrl.data.name"
|
ng-model="$ctrl.data.name"
|
||||||
required="true">
|
required="true">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
|
||||||
<vn-horizontal>
|
|
||||||
<vn-textfield
|
<vn-textfield
|
||||||
vn-one
|
vn-one
|
||||||
vn-focus
|
vn-focus
|
||||||
|
@ -24,17 +20,27 @@
|
||||||
ng-model="$ctrl.data.bic"
|
ng-model="$ctrl.data.bic"
|
||||||
required="true">
|
required="true">
|
||||||
</vn-textfield>
|
</vn-textfield>
|
||||||
<vn-autocomplete vn-one
|
</vn-horizontal>
|
||||||
|
<vn-horizontal>
|
||||||
|
<vn-autocomplete
|
||||||
|
vn-one
|
||||||
|
vn-id="country"
|
||||||
ng-model="$ctrl.data.countryFk"
|
ng-model="$ctrl.data.countryFk"
|
||||||
url="Countries"
|
url="Countries"
|
||||||
|
fields="['id', 'country', 'code']"
|
||||||
show-field="country"
|
show-field="country"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
label="Country">
|
label="Country">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
|
<vn-textfield
|
||||||
|
vn-one
|
||||||
|
ng-show="country.selection.code === 'ES'"
|
||||||
|
label="Entity code"
|
||||||
|
ng-model="$ctrl.data.id">
|
||||||
|
</vn-textfield>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
</tpl-body>
|
</tpl-body>
|
||||||
<tpl-buttons>
|
<tpl-buttons>
|
||||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||||
<button id= "saveBankEntity" response="accept" translate>Save</button>
|
<button response="accept" translate>Accept</button>
|
||||||
</tpl-buttons>
|
</tpl-buttons>
|
||||||
</vn-dialog>
|
|
|
@ -1,35 +1,23 @@
|
||||||
import ngModule from '../../module';
|
import ngModule from '../../module';
|
||||||
import Component from 'core/lib/component';
|
import Dialog from 'core/components/dialog';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
class Controller extends Component {
|
class Controller extends Dialog {
|
||||||
open() {
|
responseHandler(response) {
|
||||||
this.$.bankEntityDialog.show();
|
if (response !== 'accept')
|
||||||
}
|
return super.responseHandler(response);
|
||||||
|
|
||||||
resetData() {
|
|
||||||
this.data = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
onAccept() {
|
|
||||||
try {
|
|
||||||
if (!this.data.countryFk)
|
if (!this.data.countryFk)
|
||||||
throw new Error(`The country can't be empty`);
|
throw new Error(`The country can't be empty`);
|
||||||
|
|
||||||
this.$http.post(`bankEntities`, this.data).then(res => {
|
return this.$http.post(`bankEntities`, this.data)
|
||||||
this.vnApp.showMessage(this.$t('The bank entity has been created. You can save the data now'));
|
.then(() => super.responseHandler(response))
|
||||||
this.emit('response', {$response: res.data});
|
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
this.vnApp.showError(this.$t(e.message));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnNewBankEntity', {
|
ngModule.vnComponent('vnNewBankEntity', {
|
||||||
template: require('./index.html'),
|
slotTemplate: require('./index.html'),
|
||||||
controller: Controller,
|
controller: Controller,
|
||||||
bindings: {
|
bindings: {
|
||||||
data: '<',
|
data: '<',
|
||||||
|
|
|
@ -5,49 +5,34 @@ describe('Salix Component vnNewBankEntity', () => {
|
||||||
let $httpBackend;
|
let $httpBackend;
|
||||||
let $scope;
|
let $scope;
|
||||||
let $element;
|
let $element;
|
||||||
let vnApp;
|
|
||||||
|
|
||||||
beforeEach(ngModule('salix'));
|
beforeEach(ngModule('salix'));
|
||||||
|
|
||||||
beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _vnApp_) => {
|
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
|
||||||
$httpBackend = _$httpBackend_;
|
$httpBackend = _$httpBackend_;
|
||||||
vnApp = _vnApp_;
|
|
||||||
jest.spyOn(vnApp, 'showError');
|
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
$element = angular.element('<vn-dialog></dialog>');
|
$element = angular.element('<vn-dialog></vn-dialog>');
|
||||||
controller = $componentController('vnNewBankEntity', {$element, $scope});
|
const $transclude = {
|
||||||
|
$$boundTransclude: {
|
||||||
|
$$slots: []
|
||||||
|
}
|
||||||
|
};
|
||||||
|
controller = $componentController('vnNewBankEntity', {$element, $scope, $transclude});
|
||||||
|
controller.vnApp = {showSuccess: jest.fn()};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('resetData()', () => {
|
describe('responseHandler()', () => {
|
||||||
it('should reset the location in the controller', () => {
|
it('should show a success message after the query to bankEntities', () => {
|
||||||
expect(controller.data).toBeUndefined();
|
|
||||||
|
|
||||||
controller.resetData();
|
|
||||||
|
|
||||||
expect(controller.data).toEqual({});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('onAccept()', () => {
|
|
||||||
it('should throw an error if there is no country id in the location', () => {
|
|
||||||
jest.spyOn(controller.vnApp, 'showMessage');
|
|
||||||
|
|
||||||
controller.data = {};
|
|
||||||
|
|
||||||
controller.onAccept();
|
|
||||||
|
|
||||||
expect(controller.vnApp.showError).toHaveBeenCalledWith(`The country can't be empty`);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should do add the new bank entity', () => {
|
|
||||||
controller.data = {
|
controller.data = {
|
||||||
countryFk: 1
|
countryFk: 1
|
||||||
};
|
};
|
||||||
|
|
||||||
$httpBackend.expectPOST('bankEntities', controller.data).respond(200, controller.data);
|
$httpBackend.expectPOST('bankEntities', controller.data).respond(200);
|
||||||
|
|
||||||
controller.onAccept();
|
controller.responseHandler('accept');
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,3 +10,4 @@ The postcode has been created. You can save the data now: Se ha creado el códig
|
||||||
The city has been created: Se ha creado la ciudad
|
The city has been created: Se ha creado la ciudad
|
||||||
The province has been created: Se ha creado la provincia
|
The province has been created: Se ha creado la provincia
|
||||||
The bank entity has been created. You can save the data now: Se ha creado la entidad bancaria. Puedes guardar los datos ahora
|
The bank entity has been created. You can save the data now: Se ha creado la entidad bancaria. Puedes guardar los datos ahora
|
||||||
|
Entity code: Código de la entidad
|
|
@ -66,7 +66,7 @@
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
vn-auto
|
vn-auto
|
||||||
icon="add_circle"
|
icon="add_circle"
|
||||||
ng-click="$ctrl.onAddEntityClick($event)"
|
vn-click-stop="bankEntity.show({countryFk: $ctrl.client.countryFk})"
|
||||||
vn-tooltip="New bank entity"
|
vn-tooltip="New bank entity"
|
||||||
vn-acl="salesAssistant">
|
vn-acl="salesAssistant">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
|
@ -108,53 +108,8 @@
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Create bank entity dialog -->
|
<!-- New bankentity dialog -->
|
||||||
<vn-dialog class="edit"
|
<vn-new-bank-entity
|
||||||
vn-id="bankEntityDialog"
|
vn-id="bankEntity"
|
||||||
on-accept="$ctrl.onBankEntityAccept()"
|
on-accept="$ctrl.onAccept($data)">
|
||||||
message="New bank entity">
|
</vn-new-bank-entity>
|
||||||
<tpl-body>
|
|
||||||
<vn-horizontal>
|
|
||||||
<vn-textfield
|
|
||||||
vn-one
|
|
||||||
label="Name"
|
|
||||||
ng-model="$ctrl.newBankEntity.name"
|
|
||||||
required="true"
|
|
||||||
vn-focus>
|
|
||||||
</vn-textfield>
|
|
||||||
</vn-horizontal>
|
|
||||||
<vn-horizontal>
|
|
||||||
<vn-autocomplete
|
|
||||||
vn-one
|
|
||||||
vn-id="country"
|
|
||||||
label="Country"
|
|
||||||
ng-model="$ctrl.newBankEntity.countryFk"
|
|
||||||
fields="['id', 'country', 'code']"
|
|
||||||
url="Countries"
|
|
||||||
value-field="id"
|
|
||||||
show-field="country"
|
|
||||||
required="true">
|
|
||||||
</vn-autocomplete>
|
|
||||||
</vn-horizontal>
|
|
||||||
<vn-horizontal>
|
|
||||||
<vn-textfield
|
|
||||||
vn-one
|
|
||||||
label="Entity Code"
|
|
||||||
ng-model="$ctrl.newBankEntity.id"
|
|
||||||
ng-show="country.selection.code === 'ES'">
|
|
||||||
</vn-textfield>
|
|
||||||
</vn-horizontal>
|
|
||||||
<vn-horizontal>
|
|
||||||
<vn-textfield
|
|
||||||
vn-one
|
|
||||||
label="Swift / BIC"
|
|
||||||
ng-model="$ctrl.newBankEntity.bic"
|
|
||||||
required="true">
|
|
||||||
</vn-textfield>
|
|
||||||
</vn-horizontal>
|
|
||||||
</tpl-body>
|
|
||||||
<tpl-buttons>
|
|
||||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
|
||||||
<button response="accept" translate>Create</button>
|
|
||||||
</tpl-buttons>
|
|
||||||
</vn-dialog>
|
|
|
@ -37,17 +37,8 @@ export default class Controller extends Section {
|
||||||
return payMethod || iban || dueDay;
|
return payMethod || iban || dueDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddEntityClick(event) {
|
onAccept(data) {
|
||||||
event.preventDefault();
|
this.client.bankEntityFk = data.id;
|
||||||
this.newBankEntity = {
|
|
||||||
countryFk: Number.parseInt(this.client.countryFk)
|
|
||||||
};
|
|
||||||
this.$.bankEntityDialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
onBankEntityAccept() {
|
|
||||||
return this.$http.post(`BankEntities`, this.newBankEntity)
|
|
||||||
.then(res => this.client.bankEntityFk = res.data.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get ibanCountry() {
|
get ibanCountry() {
|
||||||
|
|
|
@ -35,20 +35,12 @@ describe('Client', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('onBankEntityAccept()', () => {
|
describe('onAccept()', () => {
|
||||||
it('should request to create a new bank entity', () => {
|
it('should assign the response id to the client bankEntityFk', () => {
|
||||||
let newBankEntity = {
|
const expectedResponse = {id: 999};
|
||||||
name: 'My new bank entity',
|
controller.onAccept(expectedResponse);
|
||||||
bic: 'ES123',
|
|
||||||
countryFk: 1,
|
|
||||||
id: 999
|
|
||||||
};
|
|
||||||
controller.newBankEntity = newBankEntity;
|
|
||||||
$httpBackend.expectPOST('BankEntities', newBankEntity).respond({id: 999});
|
|
||||||
controller.onBankEntityAccept();
|
|
||||||
$httpBackend.flush();
|
|
||||||
|
|
||||||
expect(controller.client.bankEntityFk).toEqual(newBankEntity.id);
|
expect(controller.client.bankEntityFk).toEqual(expectedResponse.id);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -15,4 +15,3 @@ Received B2B VNL: Recibido B2B VNL
|
||||||
Save: Guardar
|
Save: Guardar
|
||||||
New bank entity: Nueva entidad bancaria
|
New bank entity: Nueva entidad bancaria
|
||||||
Name can't be empty: El nombre no puede quedar vacío
|
Name can't be empty: El nombre no puede quedar vacío
|
||||||
Entity Code: Código
|
|
|
@ -30,9 +30,10 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<append>
|
<append>
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
|
vn-auto
|
||||||
icon="add_circle"
|
icon="add_circle"
|
||||||
vn-tooltip="New bank entity"
|
vn-click-stop="bankEntity.show({index: $index})"
|
||||||
ng-click="$ctrl.showBankEntity($event, $index)">
|
vn-tooltip="New bank entity">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
</append>
|
</append>
|
||||||
<vn-textfield vn-three
|
<vn-textfield vn-three
|
||||||
|
@ -65,8 +66,9 @@
|
||||||
</vn-submit>
|
</vn-submit>
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- New bankentity dialog -->
|
<!-- New bankentity dialog -->
|
||||||
<vn-new-bank-entity
|
<vn-new-bank-entity
|
||||||
vn-id="bankEntity"
|
vn-id="bankEntity"
|
||||||
on-response="$ctrl.onResponse($response)">
|
on-accept="$ctrl.onAccept($data)">
|
||||||
</vn-new-bank-entity>
|
</vn-new-bank-entity>
|
|
@ -18,23 +18,10 @@ class Controller extends Section {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onResponse(response) {
|
onAccept(data) {
|
||||||
const data = this.$.model.data;
|
const accounts = this.supplierAccounts;
|
||||||
const supplierAccount = data[this.currentRowIndex];
|
const targetAccount = accounts[data.index];
|
||||||
supplierAccount.bankEntityFk = response.id;
|
targetAccount.bankEntityFk = data.id;
|
||||||
}
|
|
||||||
|
|
||||||
showBankEntity(event, $index) {
|
|
||||||
if (event.defaultPrevented) return;
|
|
||||||
event.preventDefault();
|
|
||||||
this.currentRowIndex = $index;
|
|
||||||
this.$.bankEntity.open();
|
|
||||||
}
|
|
||||||
|
|
||||||
onBankEntityAccept() {
|
|
||||||
const query = `SupplierAccounts/${this.$params.id}/createBankEntity`;
|
|
||||||
return this.$http.patch(query, this.newBankEntity)
|
|
||||||
.then(res => this.supplierAccount.bankEntityFk = res.data.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
|
|
@ -4,11 +4,9 @@ describe('Supplier Component vnSupplierAccount', () => {
|
||||||
let $scope;
|
let $scope;
|
||||||
let $element;
|
let $element;
|
||||||
let controller;
|
let controller;
|
||||||
let $httpBackend;
|
|
||||||
beforeEach(ngModule('supplier'));
|
beforeEach(ngModule('supplier'));
|
||||||
|
|
||||||
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
|
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
|
||||||
$httpBackend = _$httpBackend_;
|
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
$scope.bankEntity = {
|
$scope.bankEntity = {
|
||||||
open: () => {}
|
open: () => {}
|
||||||
|
@ -21,50 +19,20 @@ describe('Supplier Component vnSupplierAccount', () => {
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('showBankEntity()', () => {
|
describe('onAccept()', () => {
|
||||||
it('should do nothing if it default is prevented', () => {
|
it('should set the created bank entity id into the target account', () => {
|
||||||
const event = {
|
controller.supplierAccounts = [{}, {}, {}];
|
||||||
defaultPrevented: true,
|
|
||||||
preventDefault: () => {}
|
|
||||||
};
|
|
||||||
jest.spyOn(event, 'preventDefault');
|
|
||||||
jest.spyOn(controller.$.bankEntity, 'open');
|
|
||||||
|
|
||||||
controller.showBankEntity(event);
|
const data = {
|
||||||
|
id: 999,
|
||||||
expect(event.preventDefault).not.toHaveBeenCalledWith();
|
index: 1
|
||||||
expect(controller.$.bankEntity.open).not.toHaveBeenCalledWith();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should call preventDefault() and open() when the default is not prevented', () => {
|
|
||||||
const event = {
|
|
||||||
defaultPrevented: false,
|
|
||||||
preventDefault: () => {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
jest.spyOn(event, 'preventDefault');
|
controller.onAccept(data);
|
||||||
jest.spyOn(controller.$.bankEntity, 'open');
|
|
||||||
|
|
||||||
controller.showBankEntity(event);
|
const targetAccount = controller.supplierAccounts[data.index];
|
||||||
|
|
||||||
expect(event.preventDefault).toHaveBeenCalledWith();
|
expect(targetAccount.bankEntityFk).toEqual(data.id);
|
||||||
expect(controller.$.bankEntity.open).toHaveBeenCalledWith();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should request to create a new bank entity', () => {
|
|
||||||
controller.bankEntity = {
|
|
||||||
name: 'My new bank entity',
|
|
||||||
bic: 'ES1234',
|
|
||||||
countryFk: 1,
|
|
||||||
id: 2200
|
|
||||||
};
|
|
||||||
|
|
||||||
const query = `SupplierAccounts/${controller.$.bankEntity.id}/createBankEntity`;
|
|
||||||
$httpBackend.expectPATCH(query).respond({id: 2200});
|
|
||||||
controller.onBankEntityAccept();
|
|
||||||
$httpBackend.flush();
|
|
||||||
|
|
||||||
expect(controller.supplierAccount.bankEntityFk).toEqual(controller.bankEntity.id);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue