-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend/sdoc: allow using "DESCRIPTION" or "CONTENT" field instead of…
… "STATEMENT" Closes #1823
- Loading branch information
Showing
20 changed files
with
267 additions
and
44 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
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
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
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
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
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
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
4 changes: 2 additions & 2 deletions
4
strictdoc/export/html/templates/components/requirement/statement/index.jinja
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
Empty file.
23 changes: 23 additions & 0 deletions
23
...e_requirement_empty_statement_DESCRIPTION_instead_STATEMENT/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,23 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[GRAMMAR] | ||
ELEMENTS: | ||
- TAG: REQUIREMENT | ||
FIELDS: | ||
- TITLE: TITLE | ||
TYPE: String | ||
REQUIRED: True | ||
- TITLE: DESCRIPTION | ||
TYPE: String | ||
REQUIRED: True | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[REQUIREMENT] | ||
TITLE: Requirement title | ||
DESCRIPTION: >>> | ||
Requirement statement. | ||
<<< |
23 changes: 23 additions & 0 deletions
23
...tion/update_requirement_empty_statement_DESCRIPTION_instead_STATEMENT/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: True | ||
- TITLE: DESCRIPTION | ||
TYPE: String | ||
REQUIRED: True | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[REQUIREMENT] | ||
TITLE: Requirement title | ||
DESCRIPTION: >>> | ||
Requirement statement. | ||
<<< |
42 changes: 42 additions & 0 deletions
42
..._validation/update_requirement_empty_statement_DESCRIPTION_instead_STATEMENT/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,42 @@ | ||
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") | ||
|
||
screen_document.assert_text("Hello world!") | ||
|
||
requirement = screen_document.get_requirement() | ||
form_edit_requirement: Form_EditRequirement = ( | ||
requirement.do_open_form_edit_requirement() | ||
) | ||
form_edit_requirement.do_clear_field("DESCRIPTION") | ||
form_edit_requirement.do_form_submit_and_catch_error( | ||
"Node description must not be empty." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
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
Oops, something went wrong.