refs #5284 test update
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-04-13 14:04:10 +02:00
parent 90268a79b0
commit a2ddbd8a66
2 changed files with 6 additions and 6 deletions

View File

@ -210,6 +210,7 @@ class Controller extends Section {
this.$http.post(`Claims/createFromSales`, params)
.then(res => this.$state.go('claim.card.basicData', {id: res.data.id}));
}
showTransferPopover(event) {
this.setTransferParams();
this.$.transfer.show(event);

View File

@ -63,7 +63,7 @@ describe('Ticket', () => {
controller._ticket = ticket;
controller._sales = sales;
controller.ticketConfig = [
{daysForWarningClaim: 2}
{daysForWarningClaim: 1}
];
$httpBackend.expect('GET', 'TicketConfigs').respond(200);
}));
@ -283,18 +283,17 @@ describe('Ticket', () => {
});
describe('createClaim()', () => {
it('should perform a query and call windows open', () => {
it('should call to the claimConfirm show() method', () => {
jest.spyOn(controller.$.claimConfirm, 'show').mockReturnThis();
controller.createClaim();
$httpBackend.flush();
expect(controller.$.claimConfirm);
expect(controller.$.claimConfirm.show).toHaveBeenCalledWith();
});
});
describe('onCreateClaimAccepted()', () => {
it('should perform a query and call windows open', () => {
it('should perform a query and call window open', () => {
jest.spyOn(controller, 'resetChanges').mockReturnThis();
jest.spyOn(controller.$state, 'go').mockReturnThis();
@ -305,7 +304,7 @@ describe('Ticket', () => {
const expectedParams = {ticketId: 1, sales: [firstSale]};
$httpBackend.expect('POST', `Claims/createFromSales`, expectedParams).respond(200, {id: 1});
controller.createClaim();
controller.onCreateClaimAccepted();
$httpBackend.flush();
expect(controller.resetChanges).toHaveBeenCalledWith();