-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Node form validation: allow empty SingleChoice fields when REQUIR…
…ED is False Closes #1876
- Loading branch information
Showing
5 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from strictdoc.core.environment import SDocRuntimeEnvironment | ||
|
||
__version__ = "0.0.57a2" | ||
__version__ = "0.0.57a3" | ||
|
||
|
||
environment = SDocRuntimeEnvironment(__file__) |
This file contains 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
30 changes: 30 additions & 0 deletions
30
...quirement/update_requirement_saves_empty_SingleChoice_value/expected_output/document.sdoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: TEXT | ||
FIELDS: | ||
- TITLE: UID | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: TITLE | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: CUSTOM_FIELD | ||
TYPE: SingleChoice(A, B, C) | ||
REQUIRED: False | ||
|
||
[REQUIREMENT] | ||
TITLE: Requirement title | ||
STATEMENT: >>> | ||
Requirement statement. | ||
<<< |
23 changes: 23 additions & 0 deletions
23
.../update_requirement/update_requirement_saves_empty_SingleChoice_value/input/document.sdoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: TITLE | ||
TYPE: String | ||
REQUIRED: False | ||
- TITLE: STATEMENT | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: CUSTOM_FIELD | ||
TYPE: SingleChoice(A, B, C) | ||
REQUIRED: False | ||
|
||
[REQUIREMENT] | ||
TITLE: Requirement title | ||
STATEMENT: >>> | ||
Requirement statement. | ||
<<< | ||
CUSTOM_FIELD: A |
38 changes: 38 additions & 0 deletions
38
...ocument/update_requirement/update_requirement_saves_empty_SingleChoice_value/test_case.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_requirement import ( | ||
Form_EditRequirement, | ||
) | ||
from tests.end2end.helpers.screens.project_index.screen_project_index import ( | ||
Screen_ProjectIndex, | ||
) | ||
from tests.end2end.server import SDocTestServer | ||
|
||
|
||
class Test(E2ECase): | ||
def test(self): | ||
test_setup = End2EndTestSetup(path_to_test_file=__file__) | ||
|
||
with SDocTestServer( | ||
input_path=test_setup.path_to_sandbox | ||
) as test_server: | ||
self.open(test_server.get_host_and_port()) | ||
|
||
screen_project_index = Screen_ProjectIndex(self) | ||
|
||
screen_project_index.assert_on_screen() | ||
screen_project_index.assert_contains_document("Document 1") | ||
|
||
screen_document = screen_project_index.do_click_on_first_document() | ||
|
||
screen_document.assert_on_screen_document() | ||
screen_document.assert_header_document_title("Document 1") | ||
|
||
requirement = screen_document.get_requirement() | ||
form_edit_requirement: Form_EditRequirement = ( | ||
requirement.do_open_form_edit_requirement() | ||
) | ||
form_edit_requirement.do_clear_field("CUSTOM_FIELD") | ||
form_edit_requirement.do_form_submit() | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |