I am using angularMaterialRenderers in my Angular project (version 16.2.12) with the following dependencies based on I read in this document, “Use JSON Forms 3.2 if you need to stay on Angular 16.”, I have used 3.2.0 version as well.(jsonforms/MIGRATION.md at master · eclipsesource/jsonforms · GitHub):
"@jsonforms/angular": "^3.2.1""@jsonforms/angular-material": "^3.2.1""@jsonforms/core": "^3.2.1""@jsonforms/material-renderers": "^3.2.1"
here is usage in my component :
import { angularMaterialRenderers } from '@jsonforms/angular-material';
this.renderers = angularMaterialRenderers;
<jsonforms
[(data)]="dynamicFormData"
[schema]="schema"
[uischema]="uiSchema"
[renderers]="renderers"
(errors)="setJsonFormError($event)"
></jsonforms>
The project compiles and runs successfully, and all features and functionalities work correctly on the UI.
ui schema
{
"elements": [
{
"type": "Control",
"label": "API URL",
"scope": "#/properties/properties/properties/URL"
},
{
"type": "Control",
"label": "Account",
"scope": "#/properties/credentials/properties/Account"
},
{
"type": "Control",
"label": "API Key",
"scope": "#/properties/credentials/properties/ApiKey",
"options": {
"format": "password"
}
}
],
"type": "VerticalLayout"
}
Schema
{
"type": "object",
"properties": {
"properties": {
"type": "object",
"properties": {
"URL": {
"type": "string",
"description": "The URL of the PointGrab API.",
"default": "https://cpms.pointgrab.com/be/cp"
}
},
"required": [
"URL"
]
},
"credentials": {
"type": "object",
"properties": {
"Account": {
"type": "string",
"description": "The PointGrab account."
},
"ApiKey": {
"type": "string",
"description": "The PointGrab API key."
}
},
"required": [
"Account",
"ApiKey"
]
}
},
"required": [
"properties",
"credentials"
]
}
However, when I run the test cases using npm run test, I encounter the following error:
Even I have checked module is correctly installed and present in node_modules
Test suite failed to run
Cannot find module '@jsonforms/angular-material' from 'src/app/ingress/dialogs/ingress-dialog.component.ts'
Require stack:
src/app/ingress/dialogs/ingress-dialog.component.ts
src/app/ingress/dialogs/ingress-dialog.component.spec.ts
How can I resolve this issue?