Skip to content

test: /publishers JSON-LD has a name and description (DataSpaceFrontend #443) - #140

Merged
saqibmanan merged 1 commit into
CIfrom
test-sync/DataSpaceFrontend-pr443
Sep 25, 2026
Merged

saqibmanan merged 1 commit into
CIfrom
test-sync/DataSpaceFrontend-pr443

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

Source: CivicDataLab/DataSpaceFrontend#443 (merge f7141e84, merged to dev 2026-09-08). Base: CI. This covers only the /publishers JSON-LD part of that PR, which was otherwise an ESLint/type-safety refactor.

#443 is on main, and both dev and prod serve the fixed block today, so this test is readonly and safe for the prod deploy gate.

What changed (from the diff)

PublishersListingClient.tsx builds a schema.org JSON-LD block for the /publishers page. name and description were read from Details?.data?.getPublishers?.title / .description, but getPublishers returns a list, so both were undefined and JSON.stringify dropped them. The block never had a name or description. #443 sets both explicitly ("Our Publishers" plus a description).

What this adds

tests/api/smoke/test_api_012_publishers_jsonld.py (api + seo + smoke, module-level readonly): GET /publishers, parse the application/ld+json blocks, find the single one whose url ends in /publishers, and require non-empty string name and description. The block is server-rendered, so a plain GET is enough and no browser is needed.

It's marked smoke so it runs on PRs (api-smoke selects -m "smoke"). The existing seo sitemap tests (test_api_006) have no smoke marker, so they only run under the readonly prod gate. It asserts only that the fields are present and non-empty, not the exact copy, so wording changes don't break it.

Proof (local)

Collected under both CI filters:

$ pytest tests/api/smoke -m smoke --collect-only -q    -> ...test_publishers_jsonld_has_name_and_description (42/71 collected)
$ pytest tests/api/smoke -m readonly --collect-only -q -> ...test_publishers_jsonld_has_name_and_description

Green, dev and prod:

HOME_URL_DEV=https://dev.civicdataspace.in -> 1 passed in 0.47s
HOME_URL_DEV=https://civicdataspace.in     -> 1 passed in 0.48s

Red, pre-#443 code: the old expression evaluated in Node against a list-shaped getPublishers produced
{"@context":"https://schema.org","@type":"Dataset","url":".../publishers","publisher":{...}} (no name, no description). Served locally and tested:

E  AssertionError: http://127.0.0.1:3444/publishers JSON-LD is missing 'name' (got None); keys present: ['@context', '@type', 'publisher', 'url']
1 failed in 0.34s

Gaps

  • The red run uses the old code's JSON-LD expression, not a full build of the pre-#443 frontend. A full local build was attempted and stopped when the machine ran out of disk space.
  • Publisher detail pages (/publishers/<slug>) were only type-annotated in #443, with no behaviour change, so they aren't covered here.

@saqibmanan
saqibmanan marked this pull request as ready for review September 25, 2026 19:22
@saqibmanan
saqibmanan merged commit 72e1fd9 into CI Sep 25, 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