Skip to content

Commit 44639eb

Browse files
committed
Tests update
1 parent 2ffada3 commit 44639eb

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

Diff for: components/dash-core-components/tests/integration/clipboard/test_clipboard.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from dash import Dash, html, dcc, callback, Output, Input
1+
from dash import Dash, html, dcc, callback, Output, Input, State
22

33
import dash.testing.wait as wait
44
import time
@@ -55,20 +55,27 @@ def test_clp002_clipboard_text(dash_dcc_headed):
5555
timeout=3,
5656
)
5757

58+
5859
def test_clp003_clipboard_text(dash_dcc_headed):
5960
copy_text = "Copy this text to the clipboard using a separate button"
6061
app = Dash(__name__, prevent_initial_callbacks=True)
6162
app.layout = html.Div(
62-
[dcc.Clipboard(id="copy_icon", content=copy_text), dcc.Textarea(id="paste"), html.Button("Copy", id="copy_button")]
63+
[
64+
dcc.Clipboard(id="copy_icon", content=copy_text),
65+
dcc.Textarea(id="paste"),
66+
html.Button("Copy", id="copy_button"),
67+
]
6368
)
69+
6470
@callback(
65-
Output("copy_icon", "content"),
71+
Output("copy_icon", "n_clicks"),
72+
State("copy_icon", "n_clicks"),
6673
Input("copy_button", "n_clicks"),
6774
prevent_initial_call=True,
6875
)
69-
def selected(clicks):
70-
return f"{clicks}"
71-
76+
def selected(icon_clicks, button_clicks):
77+
return icon_clicks + 1
78+
7279
dash_dcc_headed.start_server(app)
7380

7481
dash_dcc_headed.find_element("#copy_button").click()

0 commit comments

Comments
 (0)