Skip to content

Commit 0fcd2cb

Browse files
committed
improved grrs001 parameters
1 parent 694de4b commit 0fcd2cb

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

components/dash-core-components/tests/integration/graph/test_graph_responsive.py

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,35 @@
44
import flaky
55

66
from dash import Dash, Input, Output, State, dcc, html
7-
import plotly.graph_objects as go
87

98
from dash.exceptions import PreventUpdate
109
from dash.testing import wait
1110

1211

13-
@pytest.mark.parametrize("responsive", [True, False, None])
14-
@pytest.mark.parametrize("autosize", [True, False, None])
15-
@pytest.mark.parametrize("height", [600, None])
16-
@pytest.mark.parametrize("width", [600, None])
17-
@pytest.mark.parametrize("is_responsive", [True, False, "auto"])
18-
def test_grrs001_graph(dash_dcc, responsive, autosize, height, width, is_responsive):
12+
@pytest.mark.parametrize(
13+
"is_responsive,responsive,autosize,height,width",
14+
[
15+
# is_responsive=True: always responsive regardless of other params
16+
(True, None, None, None, None),
17+
(True, False, False, 600, 600), # still responsive even with fixed dims
18+
# is_responsive=False: never responsive regardless of other params
19+
(False, True, True, None, None), # not responsive even with autosize
20+
(False, None, None, 600, 600),
21+
# is_responsive="auto": behavior depends on other params
22+
("auto", True, True, None, None), # responsive: all conditions met
23+
("auto", True, True, 600, None), # responsive: one dim fixed is ok
24+
("auto", True, False, None, None), # NOT responsive: autosize=False
25+
(
26+
"auto",
27+
False,
28+
True,
29+
None,
30+
None,
31+
), # NOT responsive on resize: config.responsive=False
32+
("auto", None, None, 600, 600), # NOT responsive: both dims fixed
33+
],
34+
)
35+
def test_grrs001_graph(dash_dcc, is_responsive, responsive, autosize, height, width):
1936
app = Dash(__name__, eager_loading=True)
2037

2138
header_style = dict(padding="10px", backgroundColor="yellow", flex="0 0 100px")

0 commit comments

Comments
 (0)