test: prompt enum dropdowns (DataSpaceFrontend#465) - #105
Draft
saqibmanan wants to merge 5 commits into
Draft
saqibmanan wants to merge 5 commits into
saqibmanan wants to merge 5 commits into
Conversation
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).
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 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
__typeintrospection, 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:
smoketest_prompt_enums_the_frontend_builds_in_exist(API, read-only): the five enums exist with valuessmoketest_prv_013_ind_ai_model_domain_dropdown: AI model Domain fills with real valuesregressiontest_prv_014_prompt_dropdowns_list_every_backend_value: all five dropdowns list exactly the backend enum's valuesfunctionaltest_prv_002b/006bselect a value from four of these dropdowns on every dev deploy, so nothing duplicatedSupporting changes:
BasePage.get_combobox_options(reads a combobox's own listbox viaaria-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, aCOMBOBOX_BY_LABELlocator, and abackend_enum_labelsfixture. 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:
5 passed; red (enum renamed)1 failed, 4 passedprv_014: green1 passed; red (backend gains a value) fails withmissing ['NEW BACKEND VALUE']prv_013: green1 passed; red (threshold 999)1 failedGaps:
prv_014leaves a draft prompt dataset on dev per run, like the other create tests.