Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 4e13432

Browse files
committed
integration test
1 parent d034e25 commit 4e13432

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

test/test_integration.py

+36
Original file line numberDiff line numberDiff line change
@@ -460,3 +460,39 @@ def update_pathname(n_clicks, current_pathname):
460460
self.wait_for_text_to_equal('#test-search', '?queryA=valueA')
461461
self.wait_for_text_to_equal('#test-hash', '')
462462
self.snapshot('link -- /test/pathname/a?queryA=valueA')
463+
464+
465+
def test_candlestick(self):
466+
app = dash.Dash(__name__)
467+
app.layout = html.Div([
468+
html.Button(
469+
id='button',
470+
children='Update Candlestick',
471+
n_clicks=0
472+
),
473+
dcc.Graph(id='graph')
474+
])
475+
476+
@app.callback(Output('graph', 'figure'), [Input('button', 'n_clicks')])
477+
def update_graph(n_clicks):
478+
return {
479+
'data': [{
480+
'open': [1] * 5,
481+
'high': [3] * 5,
482+
'low': [0] * 5,
483+
'close': [2] * 5,
484+
'x': [n_clicks] * 5,
485+
'type': 'candlestick'
486+
}]
487+
}
488+
self.startServer(app=app)
489+
490+
button = self.wait_for_element_by_css_selector('#button')
491+
self.snapshot('candlestick - initial')
492+
button.click()
493+
time.sleep(2)
494+
self.snapshot('candlestick - 1 click')
495+
496+
button.click()
497+
time.sleep(2)
498+
self.snapshot('candlestick - 2 click')

0 commit comments

Comments
 (0)