Skip to content

Commit 3efdc77

Browse files
committed
remove google.com from dcc tests
1 parent 8eaa6ca commit 3efdc77

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

components/dash-core-components/tests/integration/link/test_absolute_path.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_lipa001_path(dash_dcc):
1313
]
1414
)
1515

16-
@app.callback(Output("content", "children"), [Input("url", "pathname")])
16+
@app.callback(Output("content", "children"), Input("url", "pathname"))
1717
def display_children(children):
1818
return children
1919

@@ -29,12 +29,23 @@ def display_children(children):
2929
@pytest.mark.DCC782
3030
def test_lipa002_path(dash_dcc):
3131
app = Dash(__name__)
32+
33+
def extras(t):
34+
return f"""<!DOCTYPE html>
35+
<html><body>
36+
{t[::-1]}
37+
</body></html>
38+
"""
39+
app.server.add_url_rule(
40+
"/extra/<string:t>", view_func=extras, endpoint="/extra/<string:t>", methods=["GET"]
41+
)
42+
3243
app.layout = html.Div(
3344
[
3445
dcc.Link(
3546
children="Absolute Path",
3647
id="link1",
37-
href="https://google.com",
48+
href=dash_dcc.server.url + "/extra/eseehc",
3849
refresh=True,
3950
),
4051
dcc.Location(id="url", refresh=False),
@@ -44,12 +55,13 @@ def test_lipa002_path(dash_dcc):
4455

4556
dash_dcc.wait_for_element("#link1").click()
4657

47-
location = dash_dcc.driver.execute_script(
58+
location, text = dash_dcc.driver.execute_script(
4859
"""
49-
return window.location.href
60+
return [window.location.href, document.body.textContent.trim()]
5061
"""
5162
)
5263

53-
assert location == "https://www.google.com/"
64+
assert location == dash_dcc.server.url + "/extra/eseehc"
65+
assert text == "cheese"
5466

5567
assert dash_dcc.get_logs() == []

0 commit comments

Comments
 (0)