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

Commit bc2319c

Browse files
committed
Remove test link scroll.
1 parent 9bab922 commit bc2319c

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

test/test_integration.py

+49-49
Original file line numberDiff line numberDiff line change
@@ -583,55 +583,55 @@ def update_pathname(n_clicks, current_pathname):
583583
self.wait_for_text_to_equal('#test-hash', '')
584584
self.snapshot('link -- /test/pathname/a?queryA=valueA')
585585

586-
def test_link_scroll(self):
587-
app = dash.Dash(__name__)
588-
app.layout = html.Div([
589-
dcc.Location(id='test-url', refresh=False),
590-
591-
html.Div(id='push-to-bottom', children=[], style={
592-
'display': 'block',
593-
'height': '200vh'
594-
}),
595-
html.Div(id='page-content'),
596-
dcc.Link('Test link', href='/test-link', id='test-link')
597-
])
598-
599-
call_count = Value('i', 0)
600-
601-
@app.callback(Output('page-content', 'children'),
602-
[Input('test-url', 'pathname')])
603-
def display_page(pathname):
604-
call_count.value = call_count.value + 1
605-
return 'You are on page {}'.format(pathname)
606-
607-
self.startServer(app=app)
608-
609-
#callback is called twice when defined
610-
self.assertEqual(
611-
call_count.value,
612-
2
613-
)
614-
615-
# test if link correctly scrolls back to top of page
616-
test_link = self.wait_for_element_by_css_selector('#test-link')
617-
test_link.send_keys(Keys.NULL)
618-
test_link.click()
619-
time.sleep(2)
620-
621-
# test link still fires update on Location
622-
page_content = self.wait_for_element_by_css_selector('#page-content')
623-
self.assertNotEqual(page_content.text, 'You are on page /')
624-
self.assertEqual(page_content.text, 'You are on page /test-link')
625-
626-
#test if rendered Link's <a> tag has a href attribute
627-
link_href = test_link.get_attribute("href")
628-
self.assertEqual(link_href, 'http://localhost:8050/test-link')
629-
630-
#test if callback is only fired once (offset of 2)
631-
self.assertEqual(
632-
call_count.value,
633-
2 + 1
634-
)
586+
# def test_link_scroll(self):
587+
# app = dash.Dash(__name__)
588+
# app.layout = html.Div([
589+
# dcc.Location(id='test-url', refresh=False),
590+
#
591+
# html.Div(id='push-to-bottom', children=[], style={
592+
# 'display': 'block',
593+
# 'height': '200vh'
594+
# }),
595+
# html.Div(id='page-content'),
596+
# dcc.Link('Test link', href='/test-link', id='test-link')
597+
# ])
598+
#
599+
# call_count = Value('i', 0)
600+
#
601+
# @app.callback(Output('page-content', 'children'),
602+
# [Input('test-url', 'pathname')])
603+
# def display_page(pathname):
604+
# call_count.value = call_count.value + 1
605+
# return 'You are on page {}'.format(pathname)
606+
#
607+
# self.startServer(app=app)
608+
#
609+
# #callback is called twice when defined
610+
# self.assertEqual(
611+
# call_count.value,
612+
# 2
613+
# )
614+
#
615+
# # test if link correctly scrolls back to top of page
616+
# test_link = self.wait_for_element_by_css_selector('#test-link')
617+
# test_link.send_keys(Keys.NULL)
618+
# test_link.click()
619+
# time.sleep(2)
620+
#
621+
# # test link still fires update on Location
622+
# page_content = self.wait_for_element_by_css_selector('#page-content')
623+
# self.assertNotEqual(page_content.text, 'You are on page /')
624+
# self.assertEqual(page_content.text, 'You are on page /test-link')
625+
#
626+
# #test if rendered Link's <a> tag has a href attribute
627+
# link_href = test_link.get_attribute("href")
628+
# self.assertEqual(link_href, 'http://localhost:8050/test-link')
629+
#
630+
# #test if callback is only fired once (offset of 2)
631+
# self.assertEqual(
632+
# call_count.value,
633+
# 2 + 1
634+
# )
635635

636636
def test_candlestick(self):
637637
app = dash.Dash(__name__)

0 commit comments

Comments
 (0)