From 8abd51a51a7396cfb649ee7d9ac397b1c883cf4d Mon Sep 17 00:00:00 2001 From: Kyle Beauchamp Date: Thu, 21 Jun 2018 09:38:06 -0700 Subject: [PATCH 1/3] Try to add back in tabs integration tests --- test/test_integration.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/test_integration.py b/test/test_integration.py index 0f1a511e7..dd0ef5dbd 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -220,6 +220,46 @@ def test_gallery(self): html.Div(id='waitfor'), html.Label('Upload'), dcc.Upload(), + + html.Label('Horizontal Tabs'), + html.Div([ + dcc.Tabs( + tabs=[ + {'label': 'Market Value', 'value': 1}, + {'label': 'Usage Over Time', 'value': 2}, + {'label': 'Predictions', 'value': 3}, + {'label': 'Target Pricing', 'value': 4}, + ], + value=3, + id='tabs', + vertical=False + ), + html.Div(id='tab-output') + ], style={ + 'width': '80%', + 'fontFamily': 'Sans-Serif', + 'margin-left': 'auto', + 'margin-right': 'auto' + }), + + html.Label('Vertical Tabs'), + dcc.Tabs( + tabs=[ + {'label': 'Market Value', 'value': 1}, + {'label': 'Usage Over Time', 'value': 2}, + {'label': 'Predictions', 'value': 3}, + {'label': 'Target Pricing', 'value': 4}, + ], + value=3, + id='tabs', + vertical=True, + style={ + 'borderRight': 'thin lightgrey solid', + 'textAlign': 'left' + } + ), + + html.Label('Dropdown'), dcc.Dropdown( options=[ From 12b18ffd4d8651177f45c6cbd98c6717da3feb0a Mon Sep 17 00:00:00 2001 From: Kyle Beauchamp Date: Thu, 21 Jun 2018 10:21:22 -0700 Subject: [PATCH 2/3] Use demo from 213 for integration test --- test/test_integration.py | 67 +++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/test/test_integration.py b/test/test_integration.py index dd0ef5dbd..2677d7ffa 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -224,41 +224,38 @@ def test_gallery(self): html.Label('Horizontal Tabs'), html.Div([ dcc.Tabs( - tabs=[ - {'label': 'Market Value', 'value': 1}, - {'label': 'Usage Over Time', 'value': 2}, - {'label': 'Predictions', 'value': 3}, - {'label': 'Target Pricing', 'value': 4}, - ], - value=3, - id='tabs', - vertical=False - ), - html.Div(id='tab-output') - ], style={ - 'width': '80%', - 'fontFamily': 'Sans-Serif', - 'margin-left': 'auto', - 'margin-right': 'auto' - }), - - html.Label('Vertical Tabs'), - dcc.Tabs( - tabs=[ - {'label': 'Market Value', 'value': 1}, - {'label': 'Usage Over Time', 'value': 2}, - {'label': 'Predictions', 'value': 3}, - {'label': 'Target Pricing', 'value': 4}, - ], - value=3, - id='tabs', - vertical=True, - style={ - 'borderRight': 'thin lightgrey solid', - 'textAlign': 'left' - } - ), - + children=[ + dcc.Tab(label='Tab one', children=[ + html.Div([ + dcc.Graph( + id='example-graph', + figure={ + 'data': [ + {'x': [1, 2, 3], 'y': [4, 1, 2], + 'type': 'bar', 'name': 'SF'}, + {'x': [1, 2, 3], 'y': [2, 4, 5], + 'type': 'bar', 'name': u'Montréal'}, + ], + 'layout': { + 'title': 'Dash Data Visualization' + } + } + ) + ]) + ]), + dcc.Tab(label='Tab two', children=[ + html.Div([ + html.H1("This is the content in tab 2"), + html.P("A graph here would be nice!") + ]) + ]), + dcc.Tab(label='Tab three', children=[ + html.Div([ + html.H1("This is the content in tab 3"), + ]) + ]), + ], + ), html.Label('Dropdown'), dcc.Dropdown( From d1406edeb289094dc4682c3ee030a8fd5264be73 Mon Sep 17 00:00:00 2001 From: Kyle Beauchamp Date: Thu, 21 Jun 2018 10:32:50 -0700 Subject: [PATCH 3/3] Fix typo --- test/test_integration.py | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/test/test_integration.py b/test/test_integration.py index 2677d7ffa..5f9d2d723 100644 --- a/test/test_integration.py +++ b/test/test_integration.py @@ -227,20 +227,8 @@ def test_gallery(self): children=[ dcc.Tab(label='Tab one', children=[ html.Div([ - dcc.Graph( - id='example-graph', - figure={ - 'data': [ - {'x': [1, 2, 3], 'y': [4, 1, 2], - 'type': 'bar', 'name': 'SF'}, - {'x': [1, 2, 3], 'y': [2, 4, 5], - 'type': 'bar', 'name': u'Montréal'}, - ], - 'layout': { - 'title': 'Dash Data Visualization' - } - } - ) + html.H1("This is the content in tab 1"), + html.P("A graph here would be nice!") ]) ]), dcc.Tab(label='Tab two', children=[ @@ -254,8 +242,9 @@ def test_gallery(self): html.H1("This is the content in tab 3"), ]) ]), - ], - ), + ], + ) + ]), html.Label('Dropdown'), dcc.Dropdown(