mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 14:25:02 +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.
62 lines
1.9 KiB
JSON
62 lines
1.9 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/tests.schema.json",
|
|
"schemaVersion": "2.0.0",
|
|
"package": "data_table",
|
|
"description": "Pagination functionality tests",
|
|
|
|
"testSuites": [
|
|
{
|
|
"id": "pagination-tests",
|
|
"name": "Pagination Tests",
|
|
"description": "Test page navigation and data slicing",
|
|
"tags": ["pagination", "functionality"],
|
|
|
|
"tests": [
|
|
{
|
|
"id": "test-page-size",
|
|
"name": "should respect page size setting",
|
|
"parameterized": true,
|
|
"parameters": [
|
|
{
|
|
"case": "10 items per page",
|
|
"input": { "totalItems": 25, "pageSize": 10, "page": 1 },
|
|
"expected": { "itemsOnPage": 10, "totalPages": 3 }
|
|
},
|
|
{
|
|
"case": "5 items per page",
|
|
"input": { "totalItems": 25, "pageSize": 5, "page": 1 },
|
|
"expected": { "itemsOnPage": 5, "totalPages": 5 }
|
|
},
|
|
{
|
|
"case": "last page partial",
|
|
"input": { "totalItems": 25, "pageSize": 10, "page": 3 },
|
|
"expected": { "itemsOnPage": 5, "totalPages": 3 }
|
|
}
|
|
],
|
|
"act": {
|
|
"type": "function_call",
|
|
"target": "pagination.changePage",
|
|
"input": "{{input}}"
|
|
},
|
|
"assert": {
|
|
"expectations": [
|
|
{
|
|
"type": "equals",
|
|
"actual": "result.itemsOnPage",
|
|
"expected": "{{expected.itemsOnPage}}",
|
|
"description": "Should show correct number of items"
|
|
},
|
|
{
|
|
"type": "equals",
|
|
"actual": "result.totalPages",
|
|
"expected": "{{expected.totalPages}}",
|
|
"description": "Should calculate correct total pages"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|