opensafely-core / opensafely-core/opencodelists
Validate the contents of the search tab for a codelist in functional tests
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 60
- Forks
- 16
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 17
Description
Why are we doing this?
#2421 adds some functional tests.
A codelist's search tab lists searches, along with codes and whether those codes are included or excluded.
We're not validating this tab yet. It would be good to ensure it is correct.
How will we know when it's done?
When our tests that verify the codelist result also check the searches, checking:
- the presence of each search that was entered to build the codelist
- that each included and excluded code for each search is as is expected
What are we doing?
This will need:
- The data from the Searches tab (for each search, the concept code and text) extracting.
- Deriving the expected state of each search:
- This may depend on #2541, which proposes using the relevant backend code to derive final concept states (whether included or excluded, for example).
- However, even without #2541, I think it should be possible to derive the final state of the concepts in a codelist search by:
- Do something like what we do for
expected_codelist_table(); take each concept selection in turn, and store the state (INCLUDEDorEXCLUDED) for each code. The latest selection is the one that determines the final state. - Re-apply those states to the concept selections in each search. That should give the expected state for the search (assuming we explicitly state each selection for every search).
- Do something like what we do for
- It may also be worthwhile to add some markup that makes it easier to discern included and excluded codes; at the moment, this is based on colour styling only, which is fragile.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the functional tests added by #2421 and the existing expected_codelist_table() helper. Trace how the Searches tab exposes each search's concept code and text, then define expected included or excluded states from the selections, considering the dependency on #2541. Done means the codelist result tests verify every entered search and each code's expected state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100