Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions specification/v0_10/json/basic_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
"tabs": {
"type": "array",
"description": "An array of objects, where each object defines a tab with a title and a child component.",
"minItems": 1,
Comment thread
jgindin marked this conversation as resolved.
"items": {
"type": "object",
"properties": {
Expand Down
49 changes: 49 additions & 0 deletions specification/v0_10/test/cases/tabs_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"schema": "server_to_client.json",
"tests": [
{
"description": "Tabs with empty tabs array (should fail)",
"valid": false,
"data": {
"version": "v0.10",
"updateComponents": {
"surfaceId": "test_surface",
"components": [
{
"id": "tabs_empty",
"component": "Tabs",
"tabs": []
}
]
}
}
},
{
"description": "Tabs with valid tabs array",
"valid": true,
"data": {
"version": "v0.10",
"updateComponents": {
"surfaceId": "test_surface",
"components": [
{
"id": "tabs_valid",
"component": "Tabs",
"tabs": [
{
"title": "Tab 1",
"child": "txt1"
}
]
},
{
"id": "txt1",
"component": "Text",
"text": "Tab 1 content"
}
]
}
}
}
]
}
1 change: 1 addition & 0 deletions specification/v0_9/json/basic_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@
"tabs": {
"type": "array",
"description": "An array of objects, where each object defines a tab with a title and a child component.",
"minItems": 1,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change correctly enforces that a Tabs component must have at least one tab. However, it is missing a corresponding test case for the v0.9 specification. To ensure this constraint is validated, please add a test case with a Tabs component that has an empty tabs array and is expected to fail validation.

References
  1. If there are code changes, code should have tests. (link)

"items": {
"type": "object",
"properties": {
Expand Down
49 changes: 49 additions & 0 deletions specification/v0_9/test/cases/tabs_checks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"schema": "server_to_client.json",
"tests": [
{
"description": "Tabs with empty tabs array (should fail)",
"valid": false,
"data": {
"version": "v0.9",
"updateComponents": {
"surfaceId": "test_surface",
"components": [
{
"id": "tabs_empty",
"component": "Tabs",
"tabs": []
}
]
}
}
},
{
"description": "Tabs with valid tabs array",
"valid": true,
"data": {
"version": "v0.9",
"updateComponents": {
"surfaceId": "test_surface",
"components": [
{
"id": "tabs_valid",
"component": "Tabs",
"tabs": [
{
"title": "Tab 1",
"child": "txt1"
}
]
},
{
"id": "txt1",
"component": "Text",
"text": "Tab 1 content"
}
]
}
}
}
]
}
Loading