Skip to content

Commit

Permalink
Add integration test for widget ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Jun 12, 2024
1 parent 9ab18cb commit 83e3733
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/integration/test_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,21 @@ def test_dashboard_deploys_dashboard_with_big_widget(ws, dashboard_id, tmp_path)
sdk_dashboard = dashboards.deploy_dashboard(lakeview_dashboard, dashboard_id=dashboard_id)

assert ws.lakeview.get(sdk_dashboard.dashboard_id)


def test_dashboards_deploys_dashboard_with_order_overwrite(ws, dashboard_id, tmp_path):
for query_name in range(6):
with (tmp_path / f"{query_name}.sql").open("w") as f:
f.write(f"SELECT {query_name} AS count")

# Move the '4' inbetween '1' and '2' query. Note that the order 1 puts '4' on the same position as '1', but with an
# order tiebreaker the query name decides the final order.
with (tmp_path / "4.sql").open("w") as f:
f.write("-- --order 1\nSELECT 4 AS count")

dashboards = Dashboards(ws)
lakeview_dashboard = dashboards.create_dashboard(tmp_path)

sdk_dashboard = dashboards.deploy_dashboard(lakeview_dashboard, dashboard_id=dashboard_id)

assert ws.lakeview.get(sdk_dashboard.dashboard_id)

0 comments on commit 83e3733

Please sign in to comment.