Skip to content

Commit 0a10f84

Browse files
author
Gerald Baulig
committed
fix(test): add mocks for invoice send
1 parent 902f37d commit 0a10f84

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

cfg/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
}
228228
},
229229
"invoice": {
230-
"disabled": true,
230+
"disabled": false,
231231
"address": "localhost:50077",
232232
"tech_user": {
233233
"id": "root_tech_user",

cfg/config_test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
}
201201
},
202202
"invoice": {
203-
"disabled": true,
203+
"disabled": false,
204204
"address": "localhost:50177",
205205
"mock": {
206206
"protoPath": "io/restorecommerce/invoice.proto",

src/service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,6 @@ export class OrderingService
18441844

18451845
if (this.fulfillment_service) {
18461846
this.logger?.debug('Create fulfillment on submit...');
1847-
console.log(settings);
18481847
response.fulfillments = await this._createFulfillment(
18491848
{
18501849
items: response.orders?.filter(
@@ -2080,7 +2079,6 @@ export class OrderingService
20802079
);
20812080

20822081
response.orders = request.items.map(item => response_map[item.id]);
2083-
this.logger.error('test', response);
20842082
return response;
20852083
}
20862084
catch (e: any) {

test/mocks.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ import {
5555
FulfillmentResponse,
5656
} from '@restorecommerce/rc-grpc-clients/dist/generated/io/restorecommerce/fulfillment.js';
5757
import {
58-
OperationStatus
58+
OperationStatus,
59+
StatusListResponse
5960
} from '@restorecommerce/rc-grpc-clients/dist/generated/io/restorecommerce/status.js';
6061
import {
6162
InvoiceListResponse,
@@ -1159,6 +1160,17 @@ export const rules = {
11591160
}],
11601161
totalCount: 1,
11611162
operationStatus,
1163+
}),
1164+
send: (
1165+
call: any,
1166+
callback: (error: any, response: StatusListResponse) => void,
1167+
) => callback(null, {
1168+
status: [{
1169+
id: 'invoice_1',
1170+
code: 200,
1171+
message: 'OK',
1172+
}],
1173+
operationStatus,
11621174
})
11631175
},
11641176
};

0 commit comments

Comments
 (0)