mirror of
https://github.com/MinaSaad1/pbi-cli
synced 2026-04-21 13:37:19 +00:00
fix: update visual container schema URL from 1.5.0 to 2.7.0
Update SCHEMA_VISUAL_CONTAINER constant and all 22 visual template JSON files to use visualContainer/2.7.0/schema.json instead of 1.5.0.
This commit is contained in:
parent
a8272926f3
commit
eb75d5a198
25 changed files with 568 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ SCHEMA_VERSION = (
|
|||
)
|
||||
SCHEMA_VISUAL_CONTAINER = (
|
||||
"https://developer.microsoft.com/json-schemas/"
|
||||
"fabric/item/report/definition/visualContainer/1.5.0/schema.json"
|
||||
"fabric/item/report/definition/visualContainer/2.7.0/schema.json"
|
||||
)
|
||||
SCHEMA_BOOKMARKS_METADATA = (
|
||||
"https://developer.microsoft.com/json-schemas/"
|
||||
|
|
|
|||
1
src/pbi_cli/templates/visuals/__init__.py
Normal file
1
src/pbi_cli/templates/visuals/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
"""PBIR visual templates."""
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.5.0/schema.json",
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
|
|
|
|||
27
src/pbi_cli/templates/visuals/areaChart.json
Normal file
27
src/pbi_cli/templates/visuals/areaChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "areaChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/barChart.json
Normal file
27
src/pbi_cli/templates/visuals/barChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "barChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
24
src/pbi_cli/templates/visuals/card.json
Normal file
24
src/pbi_cli/templates/visuals/card.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "card",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Fields": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
24
src/pbi_cli/templates/visuals/cardNew.json
Normal file
24
src/pbi_cli/templates/visuals/cardNew.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "cardNew",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Fields": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/1.5.0/schema.json",
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
|
|
|
|||
27
src/pbi_cli/templates/visuals/columnChart.json
Normal file
27
src/pbi_cli/templates/visuals/columnChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "columnChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/donutChart.json
Normal file
27
src/pbi_cli/templates/visuals/donutChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "donutChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/funnelChart.json
Normal file
27
src/pbi_cli/templates/visuals/funnelChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "funnelChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
24
src/pbi_cli/templates/visuals/gauge.json
Normal file
24
src/pbi_cli/templates/visuals/gauge.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "gauge",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/kpi.json
Normal file
27
src/pbi_cli/templates/visuals/kpi.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "kpi",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Indicator": {
|
||||
"projections": []
|
||||
},
|
||||
"Goal": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/lineChart.json
Normal file
27
src/pbi_cli/templates/visuals/lineChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "lineChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "lineStackedColumnComboChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"ColumnY": {
|
||||
"projections": []
|
||||
},
|
||||
"LineY": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
24
src/pbi_cli/templates/visuals/multiRowCard.json
Normal file
24
src/pbi_cli/templates/visuals/multiRowCard.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "multiRowCard",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Fields": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/pivotTable.json
Normal file
27
src/pbi_cli/templates/visuals/pivotTable.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "pivotTable",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Rows": {
|
||||
"projections": []
|
||||
},
|
||||
"Values": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/ribbonChart.json
Normal file
27
src/pbi_cli/templates/visuals/ribbonChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "ribbonChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
30
src/pbi_cli/templates/visuals/scatterChart.json
Normal file
30
src/pbi_cli/templates/visuals/scatterChart.json
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "scatterChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Details": {
|
||||
"projections": []
|
||||
},
|
||||
"X": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
24
src/pbi_cli/templates/visuals/slicer.json
Normal file
24
src/pbi_cli/templates/visuals/slicer.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "slicer",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Values": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/stackedBarChart.json
Normal file
27
src/pbi_cli/templates/visuals/stackedBarChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "stackedBarChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
24
src/pbi_cli/templates/visuals/tableEx.json
Normal file
24
src/pbi_cli/templates/visuals/tableEx.json
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "tableEx",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Values": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/treemap.json
Normal file
27
src/pbi_cli/templates/visuals/treemap.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "treemap",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Values": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
27
src/pbi_cli/templates/visuals/waterfallChart.json
Normal file
27
src/pbi_cli/templates/visuals/waterfallChart.json
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/report/definition/visualContainer/2.7.0/schema.json",
|
||||
"name": "__VISUAL_NAME__",
|
||||
"position": {
|
||||
"x": __X__,
|
||||
"y": __Y__,
|
||||
"z": __Z__,
|
||||
"height": __HEIGHT__,
|
||||
"width": __WIDTH__,
|
||||
"tabOrder": __TAB_ORDER__
|
||||
},
|
||||
"visual": {
|
||||
"visualType": "waterfallChart",
|
||||
"query": {
|
||||
"queryState": {
|
||||
"Category": {
|
||||
"projections": []
|
||||
},
|
||||
"Y": {
|
||||
"projections": []
|
||||
}
|
||||
}
|
||||
},
|
||||
"objects": {},
|
||||
"drillFilterOtherVisuals": true
|
||||
}
|
||||
}
|
||||
|
|
@ -788,3 +788,39 @@ def test_visual_set_container_no_op_returns_no_op_status(
|
|||
defn, vname = page_with_bar_visual
|
||||
result = visual_set_container(defn, "test_page", vname)
|
||||
assert result["status"] == "no-op"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task 1 (bug fix): schema URL must be 2.7.0
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_visual_add_uses_correct_schema_version(report_with_page: Path) -> None:
|
||||
result = visual_add(report_with_page, "test_page", "barChart", x=0, y=0)
|
||||
vfile = (
|
||||
report_with_page / "pages" / "test_page" / "visuals"
|
||||
/ result["name"] / "visual.json"
|
||||
)
|
||||
data = json.loads(vfile.read_text())
|
||||
assert "2.7.0" in data["$schema"]
|
||||
assert "1.5.0" not in data["$schema"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Task 2 (bug fix): visualGroup containers tagged as type "group"
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def test_visual_list_tags_group_containers_as_group(report_with_page: Path) -> None:
|
||||
"""visual_list returns visual_type 'group' for visualGroup containers."""
|
||||
visuals_dir = report_with_page / "pages" / "test_page" / "visuals"
|
||||
grp_dir = visuals_dir / "grp1"
|
||||
grp_dir.mkdir()
|
||||
_write_json(grp_dir / "visual.json", {
|
||||
"$schema": "https://example.com/schema",
|
||||
"name": "grp1",
|
||||
"visualGroup": {"displayName": "Header Group", "visuals": []}
|
||||
})
|
||||
results = visual_list(report_with_page, "test_page")
|
||||
grp = next(r for r in results if r["name"] == "grp1")
|
||||
assert grp["visual_type"] == "group"
|
||||
|
|
|
|||
Loading…
Reference in a new issue