Skip to content

Commit

Permalink
Merge pull request #1822 from plotly/no-radium
Browse files Browse the repository at this point in the history
Remove radium from renderer, and minor renderer dep bumps
  • Loading branch information
alexcjohnson authored Nov 1, 2021
2 parents deb8341 + 43e7b34 commit 2c456cd
Show file tree
Hide file tree
Showing 12 changed files with 2,536 additions and 5,817 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- [#1822](https://github.com/plotly/dash/pull/1822) Remove Radium from renderer dependencies, as part of investigating React 17 support.

- [#1745](https://github.com/plotly/dash/pull/1745):
Improve our `extras_require`: there are now five options here, each with a well-defined role:
- `dash[dev]`: for developing and building dash components.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_lipa001_path(dash_dcc):
]
)

@app.callback(Output("content", "children"), [Input("url", "pathname")])
@app.callback(Output("content", "children"), Input("url", "pathname"))
def display_children(children):
return children

Expand All @@ -29,12 +29,27 @@ def display_children(children):
@pytest.mark.DCC782
def test_lipa002_path(dash_dcc):
app = Dash(__name__)

def extras(t):
return f"""<!DOCTYPE html>
<html><body>
{t[::-1]}
</body></html>
"""

app.server.add_url_rule(
"/extra/<string:t>",
view_func=extras,
endpoint="/extra/<string:t>",
methods=["GET"],
)

app.layout = html.Div(
[
dcc.Link(
children="Absolute Path",
id="link1",
href="https://google.com",
href=dash_dcc.server.url + "/extra/eseehc",
refresh=True,
),
dcc.Location(id="url", refresh=False),
Expand All @@ -44,12 +59,13 @@ def test_lipa002_path(dash_dcc):

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

location = dash_dcc.driver.execute_script(
location, text = dash_dcc.driver.execute_script(
"""
return window.location.href
return [window.location.href, document.body.textContent.trim()]
"""
)

assert location == "https://www.google.com/"
assert location == dash_dcc.server.url + "/extra/eseehc"
assert text == "cheese"

assert dash_dcc.get_logs() == []
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def update_tooltip_content(hoverData):
assert 175 < coords[0] < 185, "x0 is about 200 minus half a marker size"
assert 175 < coords[1] < 185, "y0 is about 200 minus half a marker size"

ActionChains(dash_dcc.driver).move_to_element_with_offset(elem, 0, 0).perform()
ActionChains(dash_dcc.driver).move_to_element_with_offset(
elem, 5, elem.size["height"] - 5
).perform()

until(lambda: not dash_dcc.find_element("#graph-tooltip").is_displayed(), 3)
6 changes: 3 additions & 3 deletions components/dash-table/tests/selenium/test_markdown_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


def get_app(cell_selectable, markdown_options):
md = "[Click me](https://www.google.com)"
md = "[Click me](/assets/logo.png)"

data = [dict(a=md, b=md), dict(a=md, b=md)]

Expand Down Expand Up @@ -51,14 +51,14 @@ def test_tmdl001_click_markdown_link(test, markdown_options, new_tab, cell_selec

assert len(test.driver.window_handles) == 2
test.driver.switch_to.window(test.driver.window_handles[1])
assert test.driver.current_url.startswith("https://www.google.com")
assert test.driver.current_url.endswith("assets/logo.png")

# Make sure the cell is still selected iff cell_selectable, after switching tabs
test.driver.switch_to.window(test.driver.window_handles[0])
assert target.cell(0, "a").is_selected() == cell_selectable

else:
assert len(test.driver.window_handles) == 1
assert test.driver.current_url.startswith("https://www.google.com")
assert test.driver.current_url.endswith("assets/logo.png")

assert test.get_log_errors() == []
Loading

0 comments on commit 2c456cd

Please # to comment.