Repository navigation
test(consumer): cover JusticeHub dashboard preload/spinner embed (DataSpaceFrontend#492) - #186
Merged
Merged
Conversation
…aSpaceFrontend#492)
saqibmanan
marked this pull request as ready for review
October 9, 2026 04:58
This was referenced Oct 9, 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.
Covers DataSpaceFrontend#492 ("Fixed errors for justice-hub"), merge commit
6e6254995da6a94fd709a2fbf29f324ea42d689b, merged 2026-10-08T10:55:32Z intodev.Deployed, confirmed before trusting dev:
Deploy DataSpacerun 37766683337 on that merge commit succeeded, anddev.civicdataspace.in'sX-Git-Shaheader reads6e6254995da6a94fd709a2fbf29f324ea42d689bright now — dev genuinely serves this change, not a rolled-back deploy.What changed (from the real diff, not the title)
JusticeHub dashboards sometimes showed their logo broken/oversized because the generic dashboard iframe rendered before
justicehub.in's own stylesheet and logo had loaded in the embedded page. The fix is scoped to JusticeHub links only (isJusticeHubEmbed, by hostname): a newJusticeHubEmbedcomponent (a) adds<link rel="preconnect">+ two<link rel="preload">tags for JusticeHub's theme CSS and logo, and (b) wraps the iframe in a container witharia-busy, showing a spinner until the iframe has loaded (with one silent reload if the first load looks like a redirect bounce), then reveals it. Every other dashboard type (e.g. Superset, already covered bytest_con_usecase_dashboards.py) is untouched — same plain iframe as before.Why
smoke, and deliberately notreadonlyThis is new, UI-visible behaviour on a use-case detail page →
smoke(no Page Object existed yet for this specific embed, soUseCaseLocators/UseCasePage— already home to the sibling Superset-dashboard tests — were extended, not replaced).Not marked
readonly.git merge-base --is-ancestor 6e6254995da6a94fd709a2fbf29f324ea402c... origin/mainin DataSpaceFrontend confirms #492 has not reachedmainyet, andcivicdataspace.in(prod) sends noX-Git-Shaheader at all to gate on viadeployed_pr(..., site=...). Omittingreadonlyis the simplest safe choice here: the test simply never runs against prod (onlyreadonly-marked tests do), so it can't trip the prod-deploy smoke gate. Once #492 reachesmain, a human can addreadonly(the assertions themselves need no change).Tests added (
tests/consumer/smoke/test_con_usecase_justicehub_embed.py)Both pick their use case from the live backend at runtime (never hardcoded) — any published use case whose dashboard link's hostname is
justicehub.in/www.justicehub.in.test_justicehub_dashboard_preloads_theme_assets<link>tags are presenttest_justicehub_dashboard_is_still_embedded_and_becomes_readylink), and thearia-busywrapper clears within 12s instead of leaving the spinner up foreverExtended (not edited)
pages/consumer/usecase_page.py/locators/consumer/usecase_locators.pywithjusticehub_theme_preloaded(),justicehub_embed_becomes_ready(), and the matching locators — reusingopen_detail,has_dashboards_section,embedded_dashboardsfrom the existing Superset-dashboard tests rather than duplicating them.Proof (red → green)
Real parent-commit red, not a flipped assertion:
git merge-base --is-ancestorconfirms #492 hasn't reachedmain, so prod is genuinely still running the pre-#492 code for the exact same use case (id 302, backend-confirmed present on both dev's and prod's data).Red — prod (
HOME_URL_DEV=https://civicdataspace.in API_BASE_URL=https://api.datakeep.civicdays.in):Green — dev (
HOME_URL_DEV=https://dev.civicdataspace.in API_BASE_URL=https://dev.api.civicdataspace.in):Both fail/pass at the intended assertions — not a setup error, not a timeout at the wrong line.
Collection, under CI's real marker filter (
tests/consumer -m smoke --collect-only): both tests collected (88/92 tests collected, 4 deselected — the 4 are the existingfunctional/regression-only tests in that tree).Note on how this was run
This cloud routine has no test credentials, so only unauthenticated/public checks are in scope here — both tests are exactly that (no login, GraphQL reads + a public use-case page). Browser automation in this sandbox needed a manually version-matched chromedriver (
141.0.7390.37, fetched directly fromstorage.googleapis.comsince the sandbox's egress proxy blockswebdriver-manager's own download host); CI'sbrowser-actions/setup-chromeresolves this normally with full internet access. Nothing about the committed test or fixtures depends on that workaround.Duplicate check (§8)
No existing
test-sync/DataSpaceFrontend-pr492branch or PR before this one.Gaps / not covered
JusticeHubEmbed's one silent reload before committing to reveal) isn't separately asserted;justicehub_embed_becomes_readyonly checks the end state (resolves within 12s), which is what matters to a user.Draft only — not merging, not marking ready, not enabling auto-merge.