Skip to content

test: cover the footer Privacy link from DataSpaceFrontend#447 - #32

Merged
saqibmanan merged 2 commits into
CIfrom
test-sync/DataSpaceFrontend-pr447
Sep 9, 2026
Merged

saqibmanan merged 2 commits into
CIfrom
test-sync/DataSpaceFrontend-pr447

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

What triggered this

DataSpaceFrontend PR #447 "Added Privacy in Footer", merged into dev 2026-09-08 as e5e300a.

What actually changed (from the diff, not the title)

One file, app/[locale]/dashboard/components/main-footer.tsx, +7/-0:

  • A Privacy link was added to the footer's link row.
  • Its href is conditional: getPlatformPageUrl('/privacy', locale) on a collaborative subdomain, plain /privacy otherwise.

MainFooter is rendered by dashboard/layout.tsx, (user)/layout.tsx, and login/page.tsx — so this footer is not homepage-only, and both / and /dashboard serve it on dev. Verified the link is in the server-rendered HTML on both, so it doesn't depend on hydration.

Coverage added

Test Marker Asserts
TC_HOM_15_privacy_link_in_footer smoke Link visible in footer; href ends in /privacy
TC_HOM_16_privacy_page_renders smoke Following the link lands on /privacy and renders real content, not a 404

Plus one locator, Locators.PRIVACY_LINK.

Why two. TC_HOM_15 alone is satisfied by a link pointing at a dead route — the realistic failure mode here is the route breaking, not the anchor disappearing. TC_HOM_16 is the one that would actually catch that.

Why smoke and nothing else. This is a link and a static page. There is no API surface, no auth, no state change, and nothing performance-sensitive — functional/regression/api would all be padding. Only the non-subdomain href branch is covered; the collaborative-subdomain branch needs a collaborative subdomain to exercise and is called out as a gap below.

Proof the tests can fail

Assertions flipped to a value that cannot match (/privacy-NOPE), run, then reverted.

Red:

>       assert href.rstrip("/").endswith("/privacy-NOPE"), (
E       AssertionError: Privacy link points at 'https://dev.civicdataspace.in/privacy', expected a URL ending in /privacy
E       assert False
tests/consumer/smoke/test_components.py:73: AssertionError

>       assert "/privacy-NOPE" in driver.current_url, (
E       AssertionError: Expected to land on the privacy page, got https://dev.civicdataspace.in/privacy
E       assert '/privacy-NOPE' in 'https://dev.civicdataspace.in/privacy'
tests/consumer/smoke/test_components.py:94: AssertionError

2 failed in 7.14s

Green (reverted, against dev):

2 passed in 6.24s

Gaps found — flagged, not fixed here

  1. tests/consumer/smoke/test_components.py has a large block of dead tests. Line 57 opens a ''' that closes at line 122, so TC_HOM_02 through TC_HOM_09 sit inside a string literal and are never collected. pytest --collect-only on that file returns TC_HOM_01 and then jumps straight to TC_SEC_01. A second such block spans 135–195.

    This means the existing footer coverage (TC_HOM_07 about section, TC_HOM_08 sitemap, TC_HOM_09 contact) does not run today. The new tests were deliberately placed above line 57 so they are actually collected.

  2. Those dead tests would also fail if simply un-commented. They call wait_and_capture(driver, tc_id, By.XPATH, Locators.X) while Locators.X is already a (By.XPATH, "...") tuple — the live TC_HOM_01 unpacks it correctly with *Locators.ICON. The new tests follow the working form. Reviving that block is its own piece of work, not folded in here.

  3. Collaborative-subdomain href branch is uncovered. isCollaborativeSubdomain needs a collaborative subdomain to exercise; not reachable from the current base URL.

  4. No Page Object for the footer. Footer selectors live directly in locators/consumer/locators.py with tests using the driver fixture — consistent with how every other footer test in this file works, so the new tests match local convention rather than introducing a one-off pattern.

Note on when this actually runs

This targets CI, the branch that executes in this repo — dev is currently 5 days behind and main takes docs. Chosen from where recent test PRs (#24, #26#29) actually landed.


Draft. Generated by the pr-test-sync skill's first live run; every claim above was verified against dev rather than inferred.

Matches the <a> itself rather than its inner <span>, so a test can read
@href -- the sibling footer locators target the span and cannot.
TC_HOM_15 asserts the link is present and points at /privacy.
TC_HOM_16 follows it and asserts the destination actually renders, since
a link to a 404 would satisfy TC_HOM_15 on its own.
@saqibmanan
saqibmanan marked this pull request as ready for review September 9, 2026 08:33
@saqibmanan
saqibmanan merged commit f76d230 into CI Sep 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant