Refactor test cases for improved readability and consistency
Some checks failed
Run Tests / e2e tests (push) Failing after 1m27s
Run Tests / lint tests (push) Failing after 6s
Run Tests / unit tests (push) Failing after 7s

- Updated test functions in various test files to enhance code clarity by formatting long lines and improving indentation.
- Adjusted assertions to use multi-line formatting for better readability.
- Added new test cases for theme settings API to ensure proper functionality.
- Ensured consistent use of line breaks and spacing across test files for uniformity.
This commit is contained in:
2025-10-27 10:32:55 +01:00
parent e8a86b15e4
commit 97b1c0360b
78 changed files with 2327 additions and 650 deletions

View File

@@ -1,88 +1,49 @@
{% set nav_groups = [
{
"label": "Dashboard",
"links": [
{"href": "/", "label": "Dashboard"},
],
},
{
"label": "Scenarios",
"links": [
{"href": "/ui/scenarios", "label": "Overview"},
{"href": "/ui/parameters", "label": "Parameters"},
{"href": "/ui/costs", "label": "Costs"},
{"href": "/ui/consumption", "label": "Consumption"},
{"href": "/ui/production", "label": "Production"},
{
"href": "/ui/equipment",
"label": "Equipment",
"children": [
{"href": "/ui/maintenance", "label": "Maintenance"},
],
},
],
},
{
"label": "Analysis",
"links": [
{"href": "/ui/simulations", "label": "Simulations"},
{"href": "/ui/reporting", "label": "Reporting"},
],
},
{
"label": "Settings",
"links": [
{
"href": "/ui/settings",
"label": "Settings",
"children": [
{"href": "/ui/currencies", "label": "Currency Management"},
],
},
],
},
] %}
{% set nav_groups = [ { "label": "Dashboard", "links": [ {"href": "/", "label":
"Dashboard"}, ], }, { "label": "Overview", "links": [ {"href": "/ui/parameters",
"label": "Parameters"}, {"href": "/ui/costs", "label": "Costs"}, {"href":
"/ui/consumption", "label": "Consumption"}, {"href": "/ui/production", "label":
"Production"}, { "href": "/ui/equipment", "label": "Equipment", "children": [
{"href": "/ui/maintenance", "label": "Maintenance"}, ], }, ], }, { "label":
"Simulations", "links": [ {"href": "/ui/simulations", "label": "Simulations"},
], }, { "label": "Analytics", "links": [ {"href": "/ui/reporting", "label":
"Reporting"}, ], }, { "label": "Settings", "links": [ { "href": "/ui/settings",
"label": "Settings", "children": [ {"href": "/theme-settings", "label":
"Themes"}, {"href": "/ui/currencies", "label": "Currency Management"}, ], }, ],
}, ] %}
<nav class="sidebar-nav" aria-label="Primary navigation">
{% set current_path = request.url.path if request else "" %}
{% for group in nav_groups %}
<div class="sidebar-section">
<div class="sidebar-section-label">{{ group.label }}</div>
<div class="sidebar-section-links">
{% for link in group.links %}
{% set href = link.href %}
{% if href == "/" %}
{% set is_active = current_path == "/" %}
{% else %}
{% set is_active = current_path.startswith(href) %}
{% endif %}
<div class="sidebar-link-block">
<a
href="{{ href }}"
class="sidebar-link{% if is_active %} is-active{% endif %}"
>
{{ link.label }}
</a>
{% if link.children %}
<div class="sidebar-sublinks">
{% for child in link.children %}
{% if child.href == "/" %}
{% set child_active = current_path == "/" %}
{% else %}
{% set child_active = current_path.startswith(child.href) %}
{% endif %}
<a
href="{{ child.href }}"
class="sidebar-sublink{% if child_active %} is-active{% endif %}"
>
{{ child.label }}
</a>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
{% set current_path = request.url.path if request else "" %} {% for group in
nav_groups %}
<div class="sidebar-section">
<div class="sidebar-section-label">{{ group.label }}</div>
<div class="sidebar-section-links">
{% for link in group.links %} {% set href = link.href %} {% if href == "/"
%} {% set is_active = current_path == "/" %} {% else %} {% set is_active =
current_path.startswith(href) %} {% endif %}
<div class="sidebar-link-block">
<a
href="{{ href }}"
class="sidebar-link{% if is_active %} is-active{% endif %}"
>
{{ link.label }}
</a>
{% if link.children %}
<div class="sidebar-sublinks">
{% for child in link.children %} {% if child.href == "/" %} {% set
child_active = current_path == "/" %} {% else %} {% set child_active =
current_path.startswith(child.href) %} {% endif %}
<a
href="{{ child.href }}"
class="sidebar-sublink{% if child_active %} is-active{% endif %}"
>
{{ child.label }}
</a>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</nav>