Skip to content

Commit

Permalink
feat: add test to cover ehrbase/ehrbase#1424
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Nov 6, 2024
1 parent 1fbefb2 commit ec6fe73
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*** Settings ***
Documentation Validation test suite
... ${\n}Covers fix provided in:
... https://github.com/ehrbase/ehrbase/pull/1424
Metadata TOP_TEST_SUITE COMPOSITION

Resource ../../_resources/keywords/composition_keywords.robot
Resource ../../_resources/keywords/admin_keywords.robot
Resource ../../_resources/keywords/template_opt1.4_keywords.robot

Suite Setup Set Library Search Order For Tests


*** Variables ***
${opt_file} nodes_in_template_invalid.opt
${composition_file} nodes_in_template_invalid__compo.json
${template_id} nodes_in_template_invalid


*** Test Cases ***
Create Composition Fails If Nodes Are Not Present In Template
[Tags] Negative
Upload OPT all_types/nodes_in_template_invalid.opt
create EHR
commit composition format=CANONICAL_JSON
... composition=${composition_file}
Should Be Equal As Strings ${response.status_code} 422
Should Be Equal As Strings ${response.json()['error']} Unprocessable Entity
Should Contain ${response.json()['message']} not in template
[Teardown] Run Keywords
... (admin) delete ehr AND
... Delete Template Using API
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"template_id": {
"_type": "TEMPLATE_ID",
"value": "test_all_types.en.v1"
"value": "nodes_in_template_invalid"
},
"rm_version": "1.0.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<value>4c0d4207-562f-41d8-bbdd-3ef8b69edf61</value>
</uid>
<template_id>
<value>test_all_types.en.v1</value>
<value>nodes_in_template_invalid</value>
</template_id>
<concept>Test all types</concept>
<concept>Nodes in template invalid</concept>
<definition>
<rm_type_name>COMPOSITION</rm_type_name>
<occurrences>
Expand Down Expand Up @@ -2871,7 +2871,7 @@
<value>openEHR-EHR-COMPOSITION.test_all_types.v1</value>
</archetype_id>
<template_id>
<value>test_all_types.en.v1</value>
<value>nodes_in_template_invalid</value>
</template_id>
<term_definitions code="at0000">
<items id="description">unknown</items>
Expand Down

0 comments on commit ec6fe73

Please sign in to comment.