Skip to content

Commit b9656cf

Browse files
lmorelli986gunzip
authored andcommitted
[#158589222] Request services list to opt out (#227)
* feat: service list * feat: services list * fix: packages * fix: tests * fix: build * fix: service list
1 parent 3660191 commit b9656cf

File tree

14 files changed

+1081
-861
lines changed

14 files changed

+1081
-861
lines changed

api_notifications.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,25 @@ paths:
5454
description: There was an error in forwarding the notification to the Notification Hub.
5555
definitions:
5656
CreatedMessageWithContent:
57-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/CreatedMessageWithContent"
57+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/CreatedMessageWithContent"
5858
SenderMetadata:
59-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/SenderMetadata"
59+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/SenderMetadata"
6060
Timestamp:
61-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/Timestamp"
61+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/Timestamp"
6262
FiscalCode:
63-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/FiscalCode"
63+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/FiscalCode"
6464
MessageContent:
65-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageContent"
65+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageContent"
6666
MessageSubject:
67-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageSubject"
67+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageSubject"
6868
MessageBodyMarkdown:
69-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageBodyMarkdown"
69+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageBodyMarkdown"
7070
PaymentNoticeNumber:
71-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaymentNoticeNumber"
71+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaymentNoticeNumber"
7272
PaymentAmount:
73-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaymentAmount"
73+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaymentAmount"
7474
PaymentData:
75-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaymentData"
75+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaymentData"
7676
Notification:
7777
title: Notification
7878
description: A received Notification.

api_pagopa.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ paths:
3232
$ref: "#/definitions/ProblemJson"
3333
definitions:
3434
EmailAddress:
35-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/EmailAddress"
35+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/EmailAddress"
3636
ProblemJson:
37-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/ProblemJson"
37+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ProblemJson"
3838
PagoPAUser:
3939
title: PagoPA user
4040
description: User data needed by PagaPA proxy.

api_proxy.yaml

Lines changed: 87 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,52 @@ paths:
4141
schema:
4242
$ref: "#/definitions/ProblemJson"
4343
parameters: []
44+
"/profile/sender-services":
45+
x-swagger-router-controller: ServicesController
46+
get:
47+
operationId: getServicesByRecipient
48+
summary: Get Services by recipient
49+
description: |-
50+
Returns the service IDs of all the services that have contacted the recipient,
51+
identified by the provided fiscal code, at least once.
52+
responses:
53+
"200":
54+
description: Found.
55+
schema:
56+
$ref: "#/definitions/ServiceList"
57+
examples:
58+
application/json:
59+
page_size: 1
60+
items:
61+
- service_id: 2b3e728c1a5d1efa035c
62+
"401":
63+
description: Bearer token null or expired.
64+
"500":
65+
description: There was an error in retrieving the services.
66+
schema:
67+
$ref: "#/definitions/ProblemJson"
68+
parameters:
69+
- $ref: "#/parameters/PaginationRequest"
70+
"/services":
71+
x-swagger-router-controller: ServicesController
72+
get:
73+
operationId: getVisibleServices
74+
summary: Get all visible services
75+
description: |-
76+
Returns the description of all visible services.
77+
responses:
78+
"200":
79+
description: Found.
80+
schema:
81+
$ref: "#/definitions/ServiceList"
82+
"401":
83+
description: Bearer token null or expired.
84+
"500":
85+
description: There was an error in retrieving the services.
86+
schema:
87+
$ref: "#/definitions/ProblemJson"
88+
parameters:
89+
- $ref: "#/parameters/PaginationRequest"
4490
"/messages":
4591
x-swagger-router-controller: MessagesController
4692
parameters:
@@ -323,41 +369,41 @@ paths:
323369
description: Unavailable service
324370
definitions:
325371
BlockedInboxOrChannels:
326-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/BlockedInboxOrChannels"
372+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/BlockedInboxOrChannels"
327373
CodiceContestoPagamento:
328374
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/CodiceContestoPagamento"
329375
DepartmentName:
330-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/DepartmentName"
376+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/DepartmentName"
331377
EmailAddress:
332-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/EmailAddress"
378+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/EmailAddress"
333379
EnteBeneficiario:
334380
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/EnteBeneficiario"
335381
ExtendedProfile:
336-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/ExtendedProfile"
382+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ExtendedProfile"
337383
FiscalCode:
338-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/FiscalCode"
384+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/FiscalCode"
339385
Iban:
340386
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/Iban"
341387
ImportoEuroCents:
342388
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/ImportoEuroCents"
343389
IsInboxEnabled:
344-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/IsInboxEnabled"
390+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/IsInboxEnabled"
345391
IsWebhookEnabled:
346-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/IsWebhookEnabled"
392+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/IsWebhookEnabled"
347393
LimitedProfile:
348-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/LimitedProfile"
394+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/LimitedProfile"
349395
MessageBodyMarkdown:
350-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageBodyMarkdown"
396+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageBodyMarkdown"
351397
MessageContent:
352-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageContent"
398+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageContent"
353399
MessageResponseNotificationStatus:
354-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageResponseNotificationStatus"
400+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageResponseNotificationStatus"
355401
MessageSubject:
356-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/MessageSubject"
402+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/MessageSubject"
357403
OrganizationName:
358-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/OrganizationName"
404+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/OrganizationName"
359405
PaginationResponse:
360-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaginationResponse"
406+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaginationResponse"
361407
PaymentActivationsGetResponse:
362408
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/PaymentActivationsGetResponse"
363409
PaymentActivationsPostRequest:
@@ -367,33 +413,35 @@ definitions:
367413
PaymentRequestsGetResponse:
368414
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/PaymentRequestsGetResponse"
369415
PreferredLanguage:
370-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PreferredLanguage"
416+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PreferredLanguage"
371417
PreferredLanguages:
372-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PreferredLanguages"
418+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PreferredLanguages"
373419
ProblemJson:
374-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/ProblemJson"
420+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ProblemJson"
375421
RptIdFromString:
376422
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/RptIdFromString"
377423
ServiceId:
378-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/ServiceId"
424+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ServiceId"
379425
ServiceName:
380-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/ServiceName"
426+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ServiceName"
381427
ServicePublic:
382-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/ServicePublic"
428+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ServicePublic"
429+
ServiceTuple:
430+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/ServiceTuple"
383431
SpezzoneStrutturatoCausaleVersamento:
384432
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/SpezzoneStrutturatoCausaleVersamento"
385433
SpezzoniCausaleVersamento:
386434
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/SpezzoniCausaleVersamento"
387435
SpezzoniCausaleVersamentoItem:
388436
$ref: "https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.2.0/api_pagopa.yaml#/definitions/SpezzoniCausaleVersamentoItem"
389437
Timestamp:
390-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/Timestamp"
438+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/Timestamp"
391439
PaymentNoticeNumber:
392-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaymentNoticeNumber"
440+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaymentNoticeNumber"
393441
PaymentAmount:
394-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaymentAmount"
442+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaymentAmount"
395443
PaymentData:
396-
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/definitions.yaml#/PaymentData"
444+
$ref: "https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/definitions.yaml#/PaymentData"
397445
MessageWithContent:
398446
type: object
399447
title: Message with content
@@ -427,6 +475,21 @@ definitions:
427475
required:
428476
- id
429477
- sender_service_id
478+
ServiceList:
479+
type: object
480+
title: List of services.
481+
properties:
482+
items:
483+
type: array
484+
items:
485+
$ref: "#/definitions/ServiceTuple"
486+
next:
487+
type: string
488+
page_size:
489+
$ref: '#/definitions/PageSize'
490+
required:
491+
- items
492+
- page_size
430493
Messages:
431494
type: object
432495
title: A list of messages

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"prettify": "prettier --write './**/*.ts'",
1717
"test": "jest -i",
1818
"start": "node src/server.js",
19-
"generate:api-client": "swagger-cli bundle https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.47.1/api/public_api_v1.yaml | autorest --typescript --input-file=/dev/stdin --output-folder=src/clients/api --add-credentials --use=@microsoft.azure/autorest.typescript@2.0.157",
19+
"generate:api-client": "swagger-cli bundle https://raw.githubusercontent.com/teamdigitale/digital-citizenship-functions/v0.49.0/api/public_api_v1.yaml | autorest --typescript --input-file=/dev/stdin --output-folder=src/clients/api --add-credentials --use=@microsoft.azure/autorest.typescript@2.0.157",
2020
"generate:pagopa-client": "swagger-cli bundle https://raw.githubusercontent.com/teamdigitale/italia-pagopa-proxy/v0.3.0/api_pagopa.yaml | autorest --typescript --input-file=/dev/stdin --output-folder=src/clients/pagopa --use=@microsoft.azure/autorest.typescript@2.0.157",
2121
"generate:proxy-models": "npm-run-all generate:proxy:*",
2222
"generate:proxy:api-models": "gen-api-models --api-spec api_proxy.yaml --no-strict --out-dir src/types/api",

src/app.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,30 @@ function registerAPIRoutes(
245245
}
246246
);
247247

248+
app.get(
249+
`${basePath}/services`,
250+
bearerTokenAuth,
251+
(req: express.Request, res: express.Response) => {
252+
toExpressHandler(servicesController.getVisibleServices)(
253+
req,
254+
res,
255+
servicesController
256+
);
257+
}
258+
);
259+
260+
app.get(
261+
`${basePath}/profile/sender-services`,
262+
bearerTokenAuth,
263+
(req: express.Request, res: express.Response) => {
264+
toExpressHandler(servicesController.getServicesByRecipient)(
265+
req,
266+
res,
267+
servicesController
268+
);
269+
}
270+
);
271+
248272
app.put(
249273
`${basePath}/installations/:id`,
250274
bearerTokenAuth,

src/controllers/__tests__/serviceController.test.ts

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import { right } from "fp-ts/lib/Either";
44
import { NonNegativeInteger } from "italia-ts-commons/lib/numbers";
5-
import { NonEmptyString } from "italia-ts-commons/lib/strings";
5+
import {
6+
NonEmptyString,
7+
OrganizationFiscalCode
8+
} from "italia-ts-commons/lib/strings";
69
import mockReq from "../../__mocks__/request";
710
import mockRes from "../../__mocks__/response";
811
import ApiClient from "../../services/apiClientFactory";
@@ -27,12 +30,18 @@ const aValidSpidLevel = SpidLevelEnum["https://www.spid.gov.it/SpidL2"];
2730

2831
const proxyService: ServicePublic = {
2932
department_name: "Department name" as DepartmentName,
33+
organization_fiscal_code: "12431435345" as OrganizationFiscalCode,
3034
organization_name: "Organization name" as OrganizationName,
3135
service_id: "5a563817fcc896087002ea46c49a" as NonEmptyString,
3236
service_name: "Service name" as ServiceName,
3337
version: 42 as NonNegativeInteger
3438
};
3539

40+
const proxyServicesResponse = {
41+
items: ["5a563817fcc896087002ea46c49a", "5a563817fcc896087002ea46c49b"],
42+
page_size: 2
43+
};
44+
3645
// mock for a valid User
3746
const mockedUser: User = {
3847
created_at: aTimestamp,
@@ -58,14 +67,69 @@ const anErrorResponse = {
5867
};
5968

6069
const mockGetService = jest.fn();
70+
const mockGetServicesByRecipient = jest.fn();
6171
jest.mock("../../services/messagesService", () => {
6272
return {
6373
default: jest.fn().mockImplementation(() => ({
64-
getService: mockGetService
74+
getService: mockGetService,
75+
getServicesByRecipient: mockGetServicesByRecipient
6576
}))
6677
};
6778
});
6879

80+
describe("ServicesController#getServicesByRecipient", () => {
81+
beforeEach(() => {
82+
jest.clearAllMocks();
83+
});
84+
85+
it("calls the getServicesByRecipient on the ServicesController with valid values", async () => {
86+
const req = mockReq();
87+
88+
mockGetServicesByRecipient.mockReturnValue(
89+
Promise.resolve(right(proxyServicesResponse))
90+
);
91+
92+
req.user = mockedUser;
93+
94+
const apiClient = new ApiClient("XUZTCT88A51Y311X", "");
95+
const messageService = new MessagesService(apiClient);
96+
const controller = new ServicesController(messageService);
97+
98+
const response = await controller.getServicesByRecipient(req);
99+
100+
expect(mockGetServicesByRecipient).toHaveBeenCalledWith(mockedUser);
101+
expect(response).toEqual({
102+
apply: expect.any(Function),
103+
kind: "IResponseSuccessJson",
104+
value: proxyServicesResponse
105+
});
106+
});
107+
108+
it("calls the getServicesByRecipient on the ServicesController with empty user", async () => {
109+
const req = mockReq();
110+
const res = mockRes();
111+
112+
mockGetServicesByRecipient.mockReturnValue(
113+
Promise.resolve(right(proxyServicesResponse))
114+
);
115+
116+
req.user = "";
117+
118+
const apiClient = new ApiClient("XUZTCT88A51Y311X", "");
119+
const messageService = new MessagesService(apiClient);
120+
const controller = new ServicesController(messageService);
121+
122+
const response = await controller.getServicesByRecipient(req);
123+
response.apply(res);
124+
125+
expect(mockGetServicesByRecipient).not.toBeCalled();
126+
expect(res.json).toHaveBeenCalledWith({
127+
...anErrorResponse,
128+
detail: expect.stringContaining("Cannot extract the user from request")
129+
});
130+
});
131+
});
132+
69133
describe("serviceController#getService", () => {
70134
beforeEach(() => {
71135
jest.clearAllMocks();

0 commit comments

Comments
 (0)