test: embedded use case dashboards (DataSpaceFrontend #476) - #122
Merged
Merged
Conversation
…SpaceFrontend #476)
…ded param is actually proven
saqibmanan
marked this pull request as ready for review
September 24, 2026 14:08
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source: CivicDataLab/DataSpaceFrontend#476 (merge
8b5ac961, merged todev2026-09-24). Base:CI, the branch where the workflows run.What changed (from the diff)
The use case detail page is
/usecases/<id>, and the only files touched areDashboards.tsxandUsecaseDetailsClient.tsx.<iframe>s. Each iframe has an "Open dashboard in a new tab" link withtarget=_blankandrel=noreferrer./superset/getstandalone=1added. Other query params are kept.Added
tests/consumer/smoke/test_con_usecase_dashboards.py, markedsmokeandreadonly:test_superset_dashboard_is_embedded_standalone: the iframe titled with the dashboard's name points at the dashboard link, withstandalone=1added and the link's own params kept. The new-tab link has the same URL,_blankandnoreferrer.test_dashboards_render_above_datasets: the dashboards section comes before the datasets section in the DOM.test_section_hidden_without_embeddable_dashboards[no_dashboards | no_usable_link]: no section appears for a use case with no dashboards, or for one whose dashboards all lack an http(s) link.Use cases are chosen at runtime from the backend (
useCases+usecaseDashboards), not hardcoded. Some use cases have dashboards and some don't, and the data differs between dev and prod. If no matching use case exists, the test skips with the reason.Supporting changes:
locators/consumer/usecase_locators.py.UseCasePage.run-smoke.yml: consumer-smoke now getsAPI_BASE_URL, using the same expression api-smoke uses. The frontend's deploy workflow passes the prod API URL formain, so a prodreadonlyrun looks up prod use cases.Why
smokeonly: this is a UI-only change with no schema or resolver change, so there is noapitest. I didn't useregressionbecause run-smoke never selects that marker.Proof
Everything below ran locally. The frontend worktree was served against the dev API with
HOME_URL_DEV=http://localhost:3476.Green, at the #476 merge commit (
8b5ac961):Red, at the parent commit (
2970ce92, the page before #476):no_dashboardswith its assertion flipped, at8b5ac961:This case guards the new early
return null. It passes on the old page because the old page also hid the section when there were no dashboards.Existing tests on the affected page
test_con_006,test_con_007_use_case_download,test_publishers_flow(con_009/010/011),TC_UC_01/02test_con_007's path on the #476 build, walked in the browserVerified on dev (#476 live, 2026-09-24)
Checked in the browser on
/usecases/312:standalone=1, and the new-tab link points to the same URL.New tests plus the existing use-case tests, run serially against dev:
This PR's own consumer-smoke job (run 36006101071,
-n 4) ran all 4 new tests and they passed: 61 passed, 4 skipped, none of the skips from this file.Follow-up commit
3035a35: use case 312's dashboard link was changed to dev analytics and now already containsstandalone=1. With that link, the Superset test would pass even if the frontend stopped adding the param. The fixture now prefers a Superset link withoutstandalone(use case 322 on dev) and falls back to any Superset link.main)These tests are
readonly, so they also run in the prod gates. The DataSpaceFrontend and DataSpaceBackendmaindeploys both callrun-smoke.yml@CIwithsuite: readonly, pointed at the prod frontend. #476 is ondevonly. I ran the file against prod read-only (civicdataspace.in+api.datakeep.civicdays.in):If this PR merges into
CIbefore #476 is released, the next prod deploy of either repo fails its readonly gate and rolls back. Order: release #476 (dev→main), confirm prod shows the new page, then merge this.