mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
- Changed devDependencies from "lua_test" to "testing" in package.json for ui_level4, ui_level5, ui_level6, ui_login, ui_pages, ui_permissions, user_manager, and workflow_editor. - Removed legacy test scripts and parameterized tests, replacing them with a unified test suite structure in the tests section of package.json. - Introduced new metadata.params.json files for each package to define test parameters for package ID validation, icon file existence, and JSON schema validation. - Created new metadata.test.json files for each package to define structured test cases for validating package metadata, including checks for package ID, icon file existence, and schema validity.
224 lines
7.0 KiB
JSON
224 lines
7.0 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/json-script-components.schema.json",
|
|
"schemaVersion": "2.0.0",
|
|
"package": "lua_test",
|
|
"description": "Lua testing framework UI components for test execution and results display",
|
|
"components": [
|
|
{
|
|
"id": "test_runner",
|
|
"name": "TestRunner",
|
|
"description": "Interactive test runner component for executing Lua tests",
|
|
"props": [
|
|
{
|
|
"name": "packageId",
|
|
"type": "string",
|
|
"required": true,
|
|
"description": "Package ID to test"
|
|
},
|
|
{
|
|
"name": "autoRun",
|
|
"type": "boolean",
|
|
"required": false,
|
|
"default": false,
|
|
"description": "Automatically run tests on mount"
|
|
},
|
|
{
|
|
"name": "filter",
|
|
"type": "string",
|
|
"required": false,
|
|
"description": "Filter tests by name pattern"
|
|
},
|
|
{
|
|
"name": "verbose",
|
|
"type": "boolean",
|
|
"required": false,
|
|
"default": true,
|
|
"description": "Show verbose output"
|
|
}
|
|
],
|
|
"render": {
|
|
"type": "element",
|
|
"template": {
|
|
"type": "Card",
|
|
"variant": "outlined",
|
|
"className": "test-runner",
|
|
"children": [
|
|
{
|
|
"type": "CardHeader",
|
|
"title": "Test Runner",
|
|
"subheader": "Package: {{packageId}}",
|
|
"action": {
|
|
"type": "IconButton",
|
|
"onClick": "{{onRun}}",
|
|
"children": [
|
|
{
|
|
"type": "Icon",
|
|
"name": "PlayArrow",
|
|
"color": "primary"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"type": "CardContent",
|
|
"children": [
|
|
{
|
|
"type": "Stack",
|
|
"spacing": 2,
|
|
"children": [
|
|
{
|
|
"type": "TextField",
|
|
"label": "Filter",
|
|
"placeholder": "Filter tests by name...",
|
|
"value": "{{filter}}",
|
|
"onChange": "{{onFilterChange}}",
|
|
"size": "small",
|
|
"fullWidth": true
|
|
},
|
|
{
|
|
"type": "FormControlLabel",
|
|
"control": {
|
|
"type": "Switch",
|
|
"checked": "{{verbose}}",
|
|
"onChange": "{{onVerboseChange}}"
|
|
},
|
|
"label": "Verbose output"
|
|
},
|
|
{
|
|
"type": "conditional",
|
|
"condition": "{{isRunning}}",
|
|
"then": {
|
|
"type": "LinearProgress",
|
|
"color": "primary"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "test_results",
|
|
"name": "TestResults",
|
|
"description": "Displays test results in a formatted view with pass/fail indicators",
|
|
"props": [
|
|
{
|
|
"name": "results",
|
|
"type": "object",
|
|
"required": true,
|
|
"description": "Test results object from runner"
|
|
},
|
|
{
|
|
"name": "showDuration",
|
|
"type": "boolean",
|
|
"required": false,
|
|
"default": true,
|
|
"description": "Show test duration"
|
|
},
|
|
{
|
|
"name": "expandErrors",
|
|
"type": "boolean",
|
|
"required": false,
|
|
"default": true,
|
|
"description": "Expand error details by default"
|
|
}
|
|
],
|
|
"render": {
|
|
"type": "element",
|
|
"template": {
|
|
"type": "Card",
|
|
"variant": "outlined",
|
|
"className": "test-results",
|
|
"children": [
|
|
{
|
|
"type": "CardHeader",
|
|
"title": "Test Results",
|
|
"subheader": "{{results.summary}}"
|
|
},
|
|
{
|
|
"type": "CardContent",
|
|
"children": [
|
|
{
|
|
"type": "Stack",
|
|
"spacing": 1,
|
|
"children": [
|
|
{
|
|
"type": "Box",
|
|
"className": "results-summary",
|
|
"children": [
|
|
{
|
|
"type": "Flex",
|
|
"gap": 2,
|
|
"children": [
|
|
{
|
|
"type": "Chip",
|
|
"label": "{{results.passed}} passed",
|
|
"color": "success",
|
|
"size": "small"
|
|
},
|
|
{
|
|
"type": "Chip",
|
|
"label": "{{results.failed}} failed",
|
|
"color": "error",
|
|
"size": "small"
|
|
},
|
|
{
|
|
"type": "conditional",
|
|
"condition": "{{showDuration}}",
|
|
"then": {
|
|
"type": "Chip",
|
|
"label": "{{results.duration}}ms",
|
|
"variant": "outlined",
|
|
"size": "small"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "Divider"
|
|
},
|
|
{
|
|
"type": "List",
|
|
"dense": true,
|
|
"children": {
|
|
"type": "for_each",
|
|
"items": "{{results.tests}}",
|
|
"as": "test",
|
|
"render": {
|
|
"type": "ListItem",
|
|
"children": [
|
|
{
|
|
"type": "ListItemIcon",
|
|
"children": [
|
|
{
|
|
"type": "Icon",
|
|
"name": "{{test.status === 'passed' ? 'CheckCircle' : 'Cancel'}}",
|
|
"color": "{{test.status === 'passed' ? 'success' : 'error'}}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "ListItemText",
|
|
"primary": "{{test.name}}",
|
|
"secondary": "{{test.duration}}ms"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|