Skip to content

Commit 066ecc0

Browse files
committed
add flowtype integration test
sanity check for #207
1 parent 149cd2e commit 066ecc0

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Diff for: dev-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
dash_core_components>=0.4.0
22
dash_html_components>=0.5.0
3+
dash_flow_example
34
dash_renderer
45
percy
56
selenium

Diff for: tests/test_integration.py

+35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from multiprocessing import Value
22
import dash_html_components as html
33
import dash_core_components as dcc
4+
import dash_flow_example
45
from dash import Dash
56
from dash.dependencies import Input, Output
67
from dash.exceptions import PreventUpdate
@@ -112,3 +113,37 @@ def callback2(value):
112113
self.assertEqual(output2.text, initial_output)
113114

114115
assert_clean_console(self)
116+
117+
def test_flow_component(self):
118+
app.layout = html.Div([
119+
dash_flow_example.ExampleReactComponent(
120+
id='react',
121+
value='my-value',
122+
label='react component'
123+
),
124+
dash_flow_example.ExampleFlowComponent(
125+
id='flow',
126+
value='my-value',
127+
label='flow component'
128+
),
129+
html.Hr(),
130+
html.Div(id='output')
131+
])
132+
133+
@app.callback(Output('output', 'children'),
134+
[Input('react', 'value'), Input('flow', 'value')])
135+
def display_output(react_value, flow_value):
136+
return html.Div([
137+
'You have entered {} and {}'.format(react_value, flow_value),
138+
html.Hr(),
139+
html.Label('Flow Component Docstring'),
140+
html.Pre(dash_flow_example.ExampleFlowComponent.__doc__),
141+
html.Hr(),
142+
html.Label('React PropTypes Component Docstring'),
143+
html.Pre(dash_flow_example.ExampleReactComponent.__doc__),
144+
html.Div(id='waitfor')
145+
])
146+
147+
self.startServer(app)
148+
self.wait_for_element_by_id('waitfor')
149+
self.percy_snapshot(name='flowtype')

0 commit comments

Comments
 (0)