Skip to content

Commit d6e1b58

Browse files
committed
Modifies test to check if LogoutButton use outputs DeprecationWarning
1 parent 1b3f328 commit d6e1b58

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

components/dash-core-components/tests/integration/location/test_location_logout.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from dash.exceptions import PreventUpdate
22
from dash import Dash, Input, Output, dcc, html
33
import flask
4+
import pytest
45
import time
56

67

@@ -33,15 +34,19 @@ def _insert_cookie(rep):
3334

3435
return dcc.LogoutButton(id="logout-btn", logout_url="/_logout")
3536

36-
dash_dcc.start_server(app)
37-
time.sleep(1)
38-
dash_dcc.percy_snapshot("Core Logout button")
37+
with pytest.warns(
38+
DeprecationWarning,
39+
match="LogoutButton is deprecated, use a different component type instead",
40+
):
41+
dash_dcc.start_server(app)
42+
time.sleep(1)
43+
dash_dcc.percy_snapshot("Core Logout button")
3944

40-
assert dash_dcc.driver.get_cookie("logout-cookie")["value"] == "logged-in"
45+
assert dash_dcc.driver.get_cookie("logout-cookie")["value"] == "logged-in"
4146

42-
dash_dcc.wait_for_element("#logout-btn").click()
43-
dash_dcc.wait_for_text_to_equal("#content", "Logged out")
47+
dash_dcc.wait_for_element("#logout-btn").click()
48+
dash_dcc.wait_for_text_to_equal("#content", "Logged out")
4449

45-
assert not dash_dcc.driver.get_cookie("logout-cookie")
50+
assert not dash_dcc.driver.get_cookie("logout-cookie")
4651

47-
assert dash_dcc.get_logs() == []
52+
assert dash_dcc.get_logs() == []

0 commit comments

Comments
 (0)