Skip to content

Commit 7f1a938

Browse files
committed
Add test pages with external library.
1 parent 8a7b64c commit 7f1a938

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

tests/integration/multi_page/test_pages_layout.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
import dash
3-
from dash import Dash, Input, State, dcc, html
3+
from dash import Dash, Input, State, dcc, html, Output
44
from dash.dash import _ID_LOCATION
55
from dash.exceptions import NoLayoutException
66

@@ -235,3 +235,32 @@ def test_pala005_routing_inputs(dash_duo, clear_pages_state):
235235
# Changing the language Input re-runs the layout function
236236
dash_duo.select_dcc_dropdown("#language", "fr")
237237
dash_duo.wait_for_text_to_equal("#contents", "Le hash dit: #123")
238+
239+
240+
def test_pala006_pages_external_library(dash_duo):
241+
import dash_test_components as dt
242+
243+
app = Dash(use_pages=True, pages_folder="")
244+
245+
@app.callback(
246+
Output("out", "children"),
247+
Input("button", "n_clicks"),
248+
prevent_initial_call=True,
249+
)
250+
def on_click(n_clicks):
251+
return f"Button has been clicked {n_clicks} times"
252+
253+
dash.register_page(
254+
"page",
255+
path="/",
256+
layout=html.Div(
257+
[
258+
dt.DelayedEventComponent(id="button"),
259+
html.Div("The button has not been clicked yet", id="out"),
260+
]
261+
),
262+
)
263+
264+
dash_duo.start_server(app)
265+
dash_duo.wait_for_element("#button").click()
266+
dash_duo.wait_for_text_to_equal("#out", "Button has been clicked 1 times")

0 commit comments

Comments
 (0)