231801_test_to_master #1519

Merged
alexm merged 490 commits from 231801_test_to_master into master 2023-05-12 06:29:59 +00:00
1 changed files with 16 additions and 1 deletions
Showing only changes of commit 90268a79b0 - Show all commits

View File

@ -45,6 +45,7 @@ describe('Ticket', () => {
$scope.model = crudModel;
$scope.editDiscount = {relocate: () => {}, hide: () => {}};
$scope.editPricePopover = {relocate: () => {}};
$scope.claimConfirm = {show: () => {}};
$httpBackend = _$httpBackend_;
Object.defineProperties($state.params, {
id: {
@ -61,6 +62,10 @@ describe('Ticket', () => {
controller.card = {reload: () => {}};
controller._ticket = ticket;
controller._sales = sales;
controller.ticketConfig = [
{daysForWarningClaim: 2}
];
$httpBackend.expect('GET', 'TicketConfigs').respond(200);
}));
describe('ticket() setter', () => {
@ -113,7 +118,6 @@ describe('Ticket', () => {
it('should make an HTTP GET query and return the worker mana', () => {
controller.edit = {};
const expectedAmount = 250;
$httpBackend.expect('GET', 'Tickets/1/getSalesPersonMana').respond(200, expectedAmount);
$httpBackend.expect('GET', 'Sales/usesMana').respond(200);
$httpBackend.expect('GET', 'WorkerManas/getCurrentWorkerMana').respond(200, expectedAmount);
@ -279,6 +283,17 @@ describe('Ticket', () => {
});
describe('createClaim()', () => {
it('should perform a query and call windows open', () => {
jest.spyOn(controller.$.claimConfirm, 'show').mockReturnThis();
controller.createClaim();
$httpBackend.flush();
expect(controller.$.claimConfirm);
});
});
describe('onCreateClaimAccepted()', () => {
it('should perform a query and call windows open', () => {
jest.spyOn(controller, 'resetChanges').mockReturnThis();
jest.spyOn(controller.$state, 'go').mockReturnThis();