Skip to content

Commit 239a876

Browse files
committed
feat(fiori-mcp-server): fix tests
1 parent 0b2ce3e commit 239a876

File tree

3 files changed

+94
-146
lines changed

3 files changed

+94
-146
lines changed

packages/fiori-mcp-server/test/unit/tools/__snapshots__/list-functionalities.test.ts.snap

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ Array [
2626
Object {
2727
"description": "Creates (generates) a new SAP Fiori UI application within an existing project (RAP or other non-CAP).
2828
Crucially, you must first construct the appGenConfig JSON argument.
29-
If not provided - you **MUST** ask the user for the servicePath and host of the OData service they want to use.
30-
Then, you **MUST** query the service metadata endpoint to retrieve the list of available entities.
29+
If the user has not provided a valid servicePath and host (URL) of the OData service they want to use, you **MUST** ask for it.
30+
Next you **MUST** query the service metadata endpoint to retrieve the list of available entities.
3131
(**IMPORTANT**: service metadata endpoint URL must end with \\"$metadata\\". If the provided servicePath does not end with \\"$metadata\\", you **MUST** append it.)
32-
Lastly, using the service $metadata response xml, figure out the data model structure, entities, and associations.",
32+
(**IMPORTANT**: if the service requires authentication run 'curl' command to fetch the edmx xml response and allow the user to authenticate if needed).
33+
Lastly, using the service edmx (response xml from <serviceurl>/$metadata request), figure out the data model structure, entities, and associations.",
3334
"functionalityId": "generate-fiori-ui-odata-app",
3435
},
3536
Object {

packages/fiori-mcp-server/test/unit/tools/functionalities/generate-fiori-ui-app/__snapshots__/generate-fiori-ui-app.test.ts.snap

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Object {
1212
"name": "Generate SAP Fiori UI Application",
1313
"parameters": Object {
1414
"additionalProperties": false,
15+
"description": "The configuration that will be used for the Application UI generation.
16+
The configuration **MUST** be a valid JSON object corresponding to the inputSchema of the functionality.",
1517
"properties": Object {
1618
"entityConfig": Object {
1719
"additionalProperties": false,
@@ -26,7 +28,7 @@ Object {
2628
"additionalProperties": false,
2729
"properties": Object {
2830
"entityName": Object {
29-
"description": "The name of the main entity",
31+
"description": "The name of the main entity. EntitySet Name attribute in OData Metadata",
3032
"examples": Array [
3133
"'SalesOrder'",
3234
"'PurchaseOrderHeader'",
@@ -51,11 +53,11 @@ Object {
5153
"floorplan": Object {
5254
"description": "SAP Fiori Elements floor plan type.",
5355
"enum": Array [
54-
"FE_LROP",
55-
"FE_FEOP",
5656
"FE_FPM",
57+
"FE_LROP",
5758
"FE_OVP",
5859
"FE_ALP",
60+
"FE_FEOP",
5961
"FE_WORKLIST",
6062
"FF_SIMPLE",
6163
],
@@ -67,41 +69,44 @@ Object {
6769
"description": Object {
6870
"type": "string",
6971
},
70-
"localUI5Version": Object {
71-
"default": "1.136.7",
72-
"type": "string",
73-
},
7472
"name": Object {
7573
"pattern": "^[a-z0-9-]+$",
7674
"type": "string",
7775
},
78-
"namespace": Object {
79-
"type": "string",
76+
"sapux": Object {
77+
"default": true,
78+
"type": "boolean",
8079
},
8180
"targetFolder": Object {
82-
"description": "Absolute path to the CAP project folder (projectPath).",
81+
"description": "Absolute path to the project folder (projectPath).",
8382
"type": "string",
8483
},
8584
"title": Object {
8685
"type": "string",
8786
},
88-
"ui5Theme": Object {
89-
"type": "string",
90-
},
9187
"ui5Version": Object {
9288
"default": "1.136.7",
9389
"type": "string",
9490
},
9591
},
9692
"required": Array [
9793
"name",
98-
"targetFolder",
9994
"description",
95+
"targetFolder",
10096
"ui5Version",
101-
"localUI5Version",
97+
"sapux",
10298
],
10399
"type": "object",
104100
},
101+
"projectType": Object {
102+
"description": "SAP Fiori Elements project type. Corresponds to the SAP Fiori Elements floor plan.",
103+
"enum": Array [
104+
"LIST_REPORT_OBJECT_PAGE",
105+
"FORM_ENTRY_OBJECT_PAGE",
106+
"FLEXIBLE_PROGRAMMING_MODEL",
107+
],
108+
"type": "string",
109+
},
105110
"service": Object {
106111
"additionalProperties": false,
107112
"properties": Object {
@@ -139,32 +144,44 @@ Object {
139144
],
140145
"type": "object",
141146
},
142-
"servicePath": Object {
143-
"description": "The odata endpoint as provided by the cds mcp or as fallback in case that tool is not available from the service cds file.",
144-
"examples": Array [
145-
"/odata/v4/<servicename>/",
146-
"/odata/v4/MyRiskService/",
147-
"/odata/v2/MyOdataV2Service/",
148-
"/odata/v4/MyOdataV4Service/",
149-
"/odata/v4/<relative '@path' annotation from service cds file>/",
150-
"<absolute '@path' annotation from service cds file>/",
151-
"/myAbsolutePathFromServiceCdsFile/",
152-
],
147+
},
148+
"required": Array [
149+
"capService",
150+
],
151+
"type": "object",
152+
},
153+
"telemetryData": Object {
154+
"additionalProperties": false,
155+
"properties": Object {
156+
"generationSourceName": Object {
157+
"default": "@sap-ux/fiori-mcp-server",
158+
"type": "string",
159+
},
160+
"generationSourceVersion": Object {
161+
"default": "0.2.4",
153162
"type": "string",
154163
},
155164
},
156165
"required": Array [
157-
"servicePath",
158-
"capService",
166+
"generationSourceName",
167+
"generationSourceVersion",
159168
],
160169
"type": "object",
161170
},
171+
"version": Object {
172+
"default": "0.2",
173+
"description": "Config schema version.",
174+
"type": "string",
175+
},
162176
},
163177
"required": Array [
178+
"entityConfig",
164179
"floorplan",
165180
"project",
181+
"projectType",
166182
"service",
167-
"entityConfig",
183+
"telemetryData",
184+
"version",
168185
],
169186
"type": "object",
170187
},

0 commit comments

Comments
 (0)