|
4 | 4 | import flaky |
5 | 5 |
|
6 | 6 | from dash import Dash, Input, Output, State, dcc, html |
7 | | -import plotly.graph_objects as go |
8 | 7 |
|
9 | 8 | from dash.exceptions import PreventUpdate |
10 | 9 | from dash.testing import wait |
11 | 10 |
|
12 | 11 |
|
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): |
19 | 36 | app = Dash(__name__, eager_loading=True) |
20 | 37 |
|
21 | 38 | header_style = dict(padding="10px", backgroundColor="yellow", flex="0 0 100px") |
|
0 commit comments