Skip to content

Run the web UI tests in CI - #258

Merged
rbardaji merged 1 commit into
mainfrom
feature/257-run-ui-tests-in-ci
Aug 26, 2026
Merged

Run the web UI tests in CI#258
rbardaji merged 1 commit into
mainfrom
feature/257-run-ui-tests-in-ci

Conversation

@rbardaji

Copy link
Copy Markdown
Collaborator

Closes #257.

What this does

The ui/ suite covers 31 cases and none of them ran on a pull request. CI
installed Python dependencies and ran pytest; nothing installed npm
dependencies. Frontend regressions could land unnoticed, which matters because
most recent changes to this repository are to the UI.

File Cases Covers
src/services/oidc.test.js 16 OIDC enablement, callback detection, redirect URIs, labels
src/components/DatasetMetadata.test.js 8 Metadata rendering, spatial geometry parsing
src/services/roles.test.js 7 Role resolution, guarding the group:{uuid}:admin bug

A ui-test job is added to pr.yml and main.yml, on Node 18 to match the
ui-builder stage of Dockerfile.allinone, with npm caching keyed on
ui/package-lock.json. It runs npm test -- --watchAll=false, since
react-scripts watches for changes by default and would otherwise hang the
runner.

It is a separate job from the Python one, so a frontend failure is obvious at a
glance rather than buried in a combined log.

Removing the scaffold test

ui/src/App.test.js was the untouched Create React App template:

test('renders learn react link', () => { ... });

App.js renders the admin console router and has never contained that text, so
this test could only fail. It survived unnoticed precisely because the suite was
never run — which is the problem this PR fixes.

It is removed rather than rewritten. The value in this suite is in the
behavioural tests; a smoke test that mounts the whole App would have to stub
window.__EP_CONFIG__, which only exists at container runtime, and would be the
most fragile test here for the least benefit.

Testing

Node is not available on the machine this was written on, so the frontend suite
could not be run locally — this PR's own ui-test job is its first
execution.
If any of the 31 cases have gone stale, they surface here, before
merging, which is what the job is for.

Python side is unaffected and still green: black --check . clean across 253
files, flake8 api/ tests/ scripts/ clean, 1269 tests passed.

The ui/ suite covers 31 cases — OIDC enablement and callback handling,
role resolution including the group:{uuid}:admin bug that once locked
endpoint administrators out of the management areas, and dataset
metadata and spatial geometry parsing — and none of them ran on a pull
request. CI installed Python dependencies and ran pytest; nothing
installed npm dependencies. Frontend regressions could land unnoticed,
which matters because most recent changes here are to the UI.

Add a ui-test job to both workflows, on Node 18 to match the ui-builder
stage of Dockerfile.allinone, running `npm test -- --watchAll=false` so
react-scripts does not sit watching for changes and hang the runner.

Remove ui/src/App.test.js. It was the untouched Create React App
template asserting the page renders a "learn react" link; App.js renders
the admin console router and has never contained that text, so the test
could only fail. It survived unnoticed precisely because the suite was
never run. Removed rather than rewritten: the value here is in the
behavioural tests, and a smoke test mounting the whole router would have
to stub window.__EP_CONFIG__, which only exists at container runtime.

Closes #257
@rbardaji
rbardaji merged commit 85de4c3 into main Aug 26, 2026
2 checks passed
@rbardaji
rbardaji deleted the feature/257-run-ui-tests-in-ci branch August 26, 2026 20:00
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.

Run the web UI tests in CI

1 participant