Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
aab6afb
chore(tests/end2end): update_section_create_two_duplicate_uids: remov…
stanislaw Sep 29, 2025
9aa2fa5
chore(tests/end2end): create_section_two_sibling_sections: remove leg…
stanislaw Sep 29, 2025
3661601
chore(tests/end2end): create_section_three_nested_sections: remove le…
stanislaw Sep 29, 2025
be93dd2
chore(tests/end2end): create_section_cancel_new_section: remove legac…
stanislaw Sep 29, 2025
cbdc6f3
chore(tests/end2end): create_two_sections_then_update_with_same_uid: …
stanislaw Sep 29, 2025
8a4664c
chore(tests/end2end): create_two_section_with_same_uid: remove legacy…
stanislaw Sep 29, 2025
1a53733
chore(tests/end2end): create_section_with_uid_and_node_with_LINK: rem…
stanislaw Sep 29, 2025
db97d4e
chore(tests/end2end): create_section_must_validate_empty_name: remove…
stanislaw Sep 29, 2025
c31a8fc
chore(tests/end2end): create_section_with_nonunique_uid: remove legac…
stanislaw Sep 29, 2025
025f3b8
chore(tests/end2end): update_included_document_edit_section: remove l…
stanislaw Sep 29, 2025
5be1f00
chore(tests/end2end): update_included_document_create_child_section: …
stanislaw Sep 29, 2025
aaca245
chore(tests/end2end): update_included_document__fragment_nested_in_se…
stanislaw Sep 29, 2025
82db1a5
chore(tests/end2end): update_included_document_create_section_above_b…
stanislaw Sep 29, 2025
a2a45a8
chore(tests/end2end): update_included_document_create_first_child_sec…
stanislaw Sep 29, 2025
cfaf885
chore(tests/end2end): update_included_document_create_section_below: …
stanislaw Sep 29, 2025
79e9df6
chore(tests/end2end): update_included_document__fragment_nested_in_se…
stanislaw Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions strictdoc/backend/sdoc/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ def is_root_included_document(self) -> bool:
def is_requirement(self) -> bool:
return False

def is_document(self) -> bool:
return True

def get_display_node_type(self) -> str:
return "Document"

Expand Down
3 changes: 3 additions & 0 deletions strictdoc/backend/sdoc/models/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def __init__(
# Sections are never auto-generated, so this is always hard-coded to False.
self.autogen: bool = False

def is_document(self) -> bool:
return False

@staticmethod
def get_type_string() -> str:
return "section"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
data-turbo-action="replace"
data-turbo="true"
title="Add child SECTION"
data-testid="node-add-section-child-action"
data-testid="node-add-section-DEPRECATED-child-action"
>{% include "_res/svg_ico16_add_child.jinja" %}</a>
</li>
<li>{# 3 • Section -> add Section #}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

{%- for node, _ in view_object.document_content_iterator() %}

{%- if node.is_section() or node.is_document() %}
{%- if node.is_document() %}
{% include "components/section/index_extends_node.jinja" %}
{%- elif node.is_section() %}
{% include "components/section/index_extends_node.jinja" %}
{%- elif node.is_requirement() %}
{# {%- if node.is_text_node() %}
Expand Down
47 changes: 0 additions & 47 deletions tests/end2end/helpers/components/node/add_node_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from tests.end2end.helpers.screens.document.form_edit_requirement import (
Form_EditRequirement,
)
from tests.end2end.helpers.screens.document.form_edit_section import (
Form_EditSection,
)


class AddNode_Menu: # pylint: disable=invalid-name
Expand Down Expand Up @@ -64,50 +61,6 @@ def assert_node_has_action_add_section_child(self) -> None:
'//*[@data-testid="node-add-section-child-action"]'
)

# Add section

# From ROOT
def do_node_add_section_first(self) -> Form_EditSection:
self.test_case.click(
selector=(
'//*[@data-testid="node-root"]'
'//*[@data-testid="node-add-section-DEPRECATED-first-action"]'
),
by=By.XPATH,
)
return Form_EditSection(self.test_case)

# From Node
def do_node_add_section_above(self) -> Form_EditSection:
self.test_case.click(
selector=(
f"{self.node_xpath}"
'//*[@data-testid="node-add-section-DEPRECATED-above-action"]'
),
by=By.XPATH,
)
return Form_EditSection(self.test_case)

def do_node_add_section_below(self) -> Form_EditSection:
self.test_case.click(
selector=(
f"{self.node_xpath}"
'//*[@data-testid="node-add-section-DEPRECATED-below-action"]'
),
by=By.XPATH,
)
return Form_EditSection(self.test_case)

def do_node_add_section_child(self) -> Form_EditSection:
self.test_case.click(
selector=(
f"{self.node_xpath}"
'//*[@data-testid="node-add-section-child-action"]'
),
by=By.XPATH,
)
return Form_EditSection(self.test_case)

# Add requirement

# From ROOT
Expand Down
7 changes: 0 additions & 7 deletions tests/end2end/helpers/components/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from tests.end2end.helpers.screens.document.form_edit_requirement import (
Form_EditRequirement,
)
from tests.end2end.helpers.screens.document.form_edit_section import (
Form_EditSection,
)


class Node: # pylint: disable=invalid-name
Expand Down Expand Up @@ -166,10 +163,6 @@ def do_open_form_edit_requirement(self) -> Form_EditRequirement:
)
return Form_EditRequirement(self.test_case)

def do_open_form_edit_section(self) -> Form_EditSection:
self._do_node_edit()
return Form_EditSection(self.test_case)

def do_open_form_edit_included_document(self) -> Form_EditIncludedDocument:
self._do_node_edit()
return Form_EditIncludedDocument(self.test_case)
Expand Down
32 changes: 0 additions & 32 deletions tests/end2end/helpers/screens/document/form_edit_section.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[DOCUMENT]
TITLE: Document 1

[SECTION]
[[SECTION]]
UID: SECT-1
TITLE: First title

[/SECTION]
[[/SECTION]]

[REQUIREMENT]
UID: REQ-1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
from tests.end2end.helpers.screens.document.form_edit_requirement import (
Form_EditRequirement,
)
from tests.end2end.helpers.screens.document.form_edit_section import (
Form_EditSection,
)
from tests.end2end.helpers.screens.project_index.screen_project_index import (
Screen_ProjectIndex,
)
Expand Down Expand Up @@ -40,17 +37,17 @@ def test(self):

root_node = screen_document.get_root_node()
root_node_menu = root_node.do_open_node_menu()
form_edit_section_1: Form_EditSection = (
root_node_menu.do_node_add_section_first()
form_edit_section_1: Form_EditRequirement = (
root_node_menu.do_node_add_element_first("SECTION")
)

form_edit_section_1.do_fill_in_uid("SECT-1")
form_edit_section_1.do_fill_in_title("First title")
form_edit_section_1.do_fill_in("UID", "SECT-1")
form_edit_section_1.do_fill_in("TITLE", "First title")
form_edit_section_1.do_form_submit()

section_1 = screen_document.get_section()
section_1 = screen_document.get_node()

section_1.assert_section_title("First title", "1")
section_1.assert_requirement_title("First title", "1")
screen_document.assert_toc_contains("First title")

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ STATEMENT: >>>
Hello world!
<<<

[SECTION]
[[SECTION]]
TITLE: Section that nests a document fragment.

[SECTION]
[[SECTION]]
TITLE: First section

[/SECTION]
[[/SECTION]]

[DOCUMENT_FROM_FILE]
FILE: fragment.sdoc

[/SECTION]
[[/SECTION]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ STATEMENT: >>>
Hello world!
<<<

[SECTION]
[[SECTION]]
TITLE: Section that nests a document fragment.

[DOCUMENT_FROM_FILE]
FILE: fragment.sdoc

[/SECTION]
[[/SECTION]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from tests.end2end.e2e_case import E2ECase
from tests.end2end.end2end_test_setup import End2EndTestSetup
from tests.end2end.helpers.components.node.add_node_menu import AddNode_Menu
from tests.end2end.helpers.components.node.requirement import Requirement
from tests.end2end.helpers.components.node.section import Section
from tests.end2end.helpers.screens.document.form_edit_section import (
Form_EditSection,
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,
Expand Down Expand Up @@ -32,19 +33,19 @@ def test(self):

screen_document.assert_text("Hello world!")

section: Section = screen_document.get_section(node_order=2)
section: Section = screen_document.get_section(node_order=1)

section_menu: AddNode_Menu = section.do_open_node_menu()
form_edit_section: Form_EditSection = (
section_menu.do_node_add_section_above()
form_edit_section: Form_EditRequirement = (
section_menu.do_node_add_element_above("SECTION")
)

form_edit_section.do_fill_in_title("First section")
form_edit_section.do_fill_in("TITLE", "First section")
form_edit_section.do_form_submit()

section: Section = screen_document.get_section(2)
section: Requirement = screen_document.get_node(3)

section.assert_section_title("First section")
section.assert_requirement_title("First section")

screen_document.assert_toc_contains("First section")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ STATEMENT: >>>
Hello world!
<<<

[SECTION]
[[SECTION]]
TITLE: Section Foobar

[/SECTION]
[[/SECTION]]

[SECTION]
[[SECTION]]
TITLE: Section created by this test

[/SECTION]
[[/SECTION]]

[DOCUMENT_FROM_FILE]
FILE: fragment.sdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ STATEMENT: >>>
Hello world!
<<<

[SECTION]
[[SECTION]]
TITLE: Section Foobar

[/SECTION]
[[/SECTION]]

[DOCUMENT_FROM_FILE]
FILE: fragment.sdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from tests.end2end.e2e_case import E2ECase
from tests.end2end.end2end_test_setup import End2EndTestSetup
from tests.end2end.helpers.components.node.add_node_menu import AddNode_Menu
from tests.end2end.helpers.components.node.requirement import Requirement
from tests.end2end.helpers.components.node.section import Section
from tests.end2end.helpers.screens.document.form_edit_section import (
Form_EditSection,
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,
Expand Down Expand Up @@ -32,19 +33,21 @@ def test(self):

screen_document.assert_text("Hello world!")

section: Section = screen_document.get_section(node_order=2)
section: Section = screen_document.get_section(node_order=1)

section_menu: AddNode_Menu = section.do_open_node_menu()
form_edit_section: Form_EditSection = (
section_menu.do_node_add_section_above()
form_edit_section: Form_EditRequirement = (
section_menu.do_node_add_element_above("SECTION")
)

form_edit_section.do_fill_in_title("Section created by this test")
form_edit_section.do_fill_in(
"TITLE", "Section created by this test"
)
form_edit_section.do_form_submit()

section: Section = screen_document.get_section(2)
section: Requirement = screen_document.get_node(3)

section.assert_section_title("Section created by this test")
section.assert_requirement_title("Section created by this test")

screen_document.assert_toc_contains("Section created by this test")

Expand All @@ -56,7 +59,7 @@ def test(self):
# A basic extra test that ensures that the section has a right
# document parent (encountered this regression during implementation).
#
form_edit_section = section.do_open_form_edit_section()
form_edit_section = section.do_open_form_edit_requirement()
form_edit_section.do_form_submit()

screen_document.assert_toc_contains("Section Foobar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Hello world!
[DOCUMENT_FROM_FILE]
FILE: fragment.sdoc

[SECTION]
[[SECTION]]
TITLE: First section

[/SECTION]
[[/SECTION]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[project]

section_behavior = "[[SECTION]]"
Loading
Loading