Skip to content

Commit be09046

Browse files
committed
add callback tests
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent 02c3ba1 commit be09046

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-FileCopyrightText: 2025 Contributors to the Power Grid Model project <[email protected]>
2+
#
3+
# SPDX-License-Identifier: MPL-2.0
4+
5+
from power_grid_model_ds._core.visualizer.callbacks.element_scaling import scale_elements
6+
from power_grid_model_ds._core.visualizer.callbacks.search_form import search_element
7+
from power_grid_model_ds._core.visualizer.layout.cytoscape_styling import DEFAULT_STYLESHEET
8+
9+
10+
def test_scale_elements():
11+
assert scale_elements(1, 1)
12+
13+
14+
def test_search_element_no_input():
15+
assert search_element(group="", column="", operator="", value="") == DEFAULT_STYLESHEET
16+
17+
18+
def test_search_element_with_input():
19+
group = "node"
20+
column = "id"
21+
operator = "="
22+
value = "1"
23+
24+
expected_selector = f'[{column} {operator} "{value}"]'
25+
26+
result = search_element(group, column, operator, value)
27+
assert result[-1]["selector"] == expected_selector

0 commit comments

Comments
 (0)