Skip to content

test: prompt enum dropdowns (DataSpaceFrontend#465) - #105

Draft
saqibmanan wants to merge 5 commits into
CIfrom
test-sync/DataSpaceFrontend-pr465
Draft

saqibmanan wants to merge 5 commits into
CIfrom
test-sync/DataSpaceFrontend-pr465

Conversation

@saqibmanan

@saqibmanan saqibmanan commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Covers CivicDataLab/DataSpaceFrontend#465 (merge 0b45273). Base: CI, the branch whose workflows run.

What changed (from the diff): the prompt dropdowns — Task Type, Domain, Target Languages, Target Model Types on the dataset metadata form, Domain on the AI model edit page, and Prompt Format on the resource edit view — used to fetch their options with runtime __type introspection, which could be aborted and cached as empty. They now read enums compiled in at build time. The new risk: a frontend built against an older schema silently lacks new values.

Tests, one per marker:

Marker Test Runs in
smoke test_prompt_enums_the_frontend_builds_in_exist (API, read-only): the five enums exist with values dev smoke stage, PR gate, prod
smoke test_prv_013_ind_ai_model_domain_dropdown: AI model Domain fills with real values dev smoke stage, PR gate
regression test_prv_014_prompt_dropdowns_list_every_backend_value: all five dropdowns list exactly the backend enum's values PR gate
functional already covered: test_prv_002b/006b select a value from four of these dropdowns on every dev deploy, so nothing duplicated dev functional stage

Supporting changes: BasePage.get_combobox_options (reads a combobox's own listbox via aria-controls; opens with a JS click because these lists don't close on Escape, Tab or blur), CreateDatasetPage.get_prompt_field_options / upload_prompt_file_and_open, a COMBOBOX_BY_LABEL locator, and a backend_enum_labels fixture. The upload helper's first half is split out as _upload; test_prv_002/002b/006/006b re-run after that: 4 passed, retries off.

Proof against dev, retries off:

  • API smoke: green 5 passed; red (enum renamed) 1 failed, 4 passed
  • prv_014: green 1 passed; red (backend gains a value) fails with missing ['NEW BACKEND VALUE']
  • prv_013: green 1 passed; red (threshold 999) 1 failed

Gaps: prv_014 leaves a draft prompt dataset on dev per run, like the other create tests.

DataSpaceFrontend#465 (closes #463) replaced four runtime __type
introspection queries with a static enumValues() helper reading
PromptDomain/PromptTaskType/TargetLanguage/TargetModelType/PromptFormat
from codegen, after the introspection queries firing together on form
load could be aborted under load and leave the dropdowns permanently
empty (staleTime: Infinity cached the failure).

The AI model edit details page's Domain <select> was the one spot this
touched with no existing coverage: test_prv_012 (create AI model) never
touches the Domain field, and the dataset-side Domain/Task
Type/Target Language/Target Model Type dropdowns are already exercised
by test_prv_002b/006b via the same create->edit/metadata redirect.

Adds get_domain_option_values() to CreateAiModelPage, reusing the
existing DOMAIN_SELECT locator, and asserts the dropdown populates with
real PromptDomain values rather than just the placeholder.
get_combobox_options reads every option from the combobox's own listbox
(aria-controls), opening it with a JS click because these lists don't close on
Escape, Tab or blur and would swallow the next real click. _upload is split out
of the upload helper so a test can stay on the uploaded file's edit view.
Regression for DataSpaceFrontend#465, which compiles these options in at build
time: a frontend built against an older schema would silently drop new values.
Covers Task Type, Domain, Target Languages, Target Model Types and Prompt Format.
…owns from

Read-only introspection; a backend rename or removal breaks the frontend's
codegen and empties the dropdowns (DataSpaceFrontend#465).
@saqibmanan saqibmanan changed the title test: cover AI model edit Domain dropdown (DataSpaceFrontend#465) test: prompt enum dropdowns (DataSpaceFrontend#465) Sep 18, 2026
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