This commit is contained in:
parent
90268a79b0
commit
a2ddbd8a66
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue