Files
metabuilder/packages/data_table/tests/components.test.json
johndoe6345789 ef709d47c0 refactor: update testing framework and restructure test configurations
- 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.
2026-01-02 21:25:45 +00:00

125 lines
3.5 KiB
JSON

{
"$schema": "https://metabuilder.dev/schemas/tests.schema.json",
"schemaVersion": "2.0.0",
"package": "data_table",
"description": "Component definition and rendering tests",
"testSuites": [
{
"id": "component-definitions",
"name": "Component Definition Tests",
"description": "Validate component schema and structure",
"tags": ["components", "schema"],
"tests": [
{
"id": "test-datagrid-component-exists",
"name": "DataGrid component should be defined",
"act": {
"type": "function_call",
"target": "getComponent",
"input": {
"package": "data_table",
"component": "DataGrid"
}
},
"assert": {
"expectations": [
{
"type": "notNull",
"actual": "result",
"description": "DataGrid component should exist"
},
{
"type": "equals",
"actual": "result.name",
"expected": "DataGrid",
"description": "Component name should be DataGrid"
}
]
}
},
{
"id": "test-datagrid-required-props",
"name": "DataGrid should have required props",
"act": {
"type": "function_call",
"target": "getComponentProps",
"input": {
"package": "data_table",
"component": "DataGrid"
}
},
"assert": {
"expectations": [
{
"type": "hasProperty",
"actual": "result",
"expected": "columns",
"description": "Should have columns prop"
},
{
"type": "hasProperty",
"actual": "result",
"expected": "data",
"description": "Should have data prop"
}
]
}
}
]
},
{
"id": "component-rendering",
"name": "Component Rendering Tests",
"description": "Test component rendering with various props",
"tags": ["rendering", "integration"],
"tests": [
{
"id": "test-render-basic-table",
"name": "should render basic data table",
"arrange": {
"given": "valid columns and data props",
"fixtures": {
"columns": [
{ "id": "name", "label": "Name" },
{ "id": "age", "label": "Age" }
],
"data": [
{ "id": 1, "name": "John", "age": 30 },
{ "id": 2, "name": "Jane", "age": 25 }
]
}
},
"act": {
"when": "the component is rendered",
"type": "function_call",
"target": "renderComponent",
"input": {
"component": "DataGrid",
"props": "{{fixtures}}"
}
},
"assert": {
"then": "the table should render correctly",
"expectations": [
{
"type": "notNull",
"actual": "result",
"description": "Render output should exist"
},
{
"type": "hasProperty",
"actual": "result",
"expected": "type",
"description": "Should have type property"
}
]
}
}
]
}
]
}