feat: Enable passing a permalink to cache_dashboard_screenshot endpoint (#32900)

This commit is contained in:
Kamil Gabryjelski
2025-03-31 10:40:36 +02:00
committed by GitHub
parent 8f35a3ec8c
commit b92909d621
4 changed files with 25 additions and 10 deletions

View File

@@ -3038,6 +3038,18 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas
response = self._cache_screenshot(dashboard.id)
assert response.status_code == 202
@with_feature_flags(THUMBNAILS=True, ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS=True)
@pytest.mark.usefixtures("create_dashboard_with_tag")
def test_cache_dashboard_screenshot_success_permalink_payload(self):
self.login(ADMIN_USERNAME)
dashboard = (
db.session.query(Dashboard)
.filter(Dashboard.dashboard_title == "dash with tag")
.first()
)
response = self._cache_screenshot(dashboard.id, {"permalinkKey": "1234"})
assert response.status_code == 202
@with_feature_flags(THUMBNAILS=True, ENABLE_DASHBOARD_SCREENSHOT_ENDPOINTS=True)
@pytest.mark.usefixtures("create_dashboard_with_tag")
def test_cache_dashboard_screenshot_dashboard_validation(self):