Files
metabuilder/packages/data_table/tests/pagination.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

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"
}
]
}
}
]
}
]
}