@@ -24,6 +24,7 @@ import _ from 'lodash';
2424
2525import { createSignerMock , type SignerMock } from '../../../test/fixtures/web3' ;
2626
27+ import { CvatJobType , FortuneJobType } from '../../common/enums' ;
2728import { ServerConfigService } from '../../config/server-config.service' ;
2829
2930import { ReputationService } from '../reputation/reputation.service' ;
@@ -1079,4 +1080,42 @@ describe('EscrowCompletionService', () => {
10791080 } ,
10801081 ) ;
10811082 } ) ;
1083+
1084+ describe ( 'getEscrowResultsProcessor' , ( ) => {
1085+ it . each ( Object . values ( FortuneJobType ) ) (
1086+ 'should return fortune processor for "%s" job type' ,
1087+ ( jobRequestType ) => {
1088+ expect ( service [ 'getEscrowResultsProcessor' ] ( jobRequestType ) ) . toBe (
1089+ mockFortuneResultsProcessor ,
1090+ ) ;
1091+ } ,
1092+ ) ;
1093+ it . each ( Object . values ( CvatJobType ) ) (
1094+ 'should return cvat processor for "%s" job type' ,
1095+ ( jobRequestType ) => {
1096+ expect ( service [ 'getEscrowResultsProcessor' ] ( jobRequestType ) ) . toBe (
1097+ mockCvatResultsProcessor ,
1098+ ) ;
1099+ } ,
1100+ ) ;
1101+ } ) ;
1102+
1103+ describe ( 'getEscrowPayoutsCalculator' , ( ) => {
1104+ it . each ( Object . values ( FortuneJobType ) ) (
1105+ 'should return fortune calculator for "%s" job type' ,
1106+ ( jobRequestType ) => {
1107+ expect ( service [ 'getEscrowPayoutsCalculator' ] ( jobRequestType ) ) . toBe (
1108+ mockFortunePayoutsCalculator ,
1109+ ) ;
1110+ } ,
1111+ ) ;
1112+ it . each ( Object . values ( CvatJobType ) ) (
1113+ 'should return cvat calculator for "%s" job type' ,
1114+ ( jobRequestType ) => {
1115+ expect ( service [ 'getEscrowPayoutsCalculator' ] ( jobRequestType ) ) . toBe (
1116+ mockCvatPayoutsCalculator ,
1117+ ) ;
1118+ } ,
1119+ ) ;
1120+ } ) ;
10821121} ) ;
0 commit comments