Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.3k
Issue 481 - Support arbitrary file extensions in component suites#1078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
38a4476079de91b74f49f8d8669a4fbd4ac68af79aba10c387c862f7bd70c7dac434fa3c31cfe9f3cedee90d4266719aa69d8681f0eacb13cde454dd606d25c7c4bb90b0292c8cad783c1c1d3a7676a90407d95718419e45bc8146File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| @font-face { | ||
| font-family: 'godfather'; | ||
| src: url(./godfather.ttf) format('truetype'); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,12 @@ | ||
| from dash import Dash | ||
| from dash.dependencies import Input, Output | ||
| from dash.exceptions import PreventUpdate | ||
| from dash_generator_test_component_nested import MyNestedComponent | ||
| from dash_generator_test_component_standard import MyStandardComponent | ||
| from dash_html_components import Div | ||
| from dash_html_components import Button, Div | ||
| from selenium.webdriver.support.ui import WebDriverWait | ||
| def test_gene001_simple_callback(dash_duo): | ||
| @@ -18,3 +23,39 @@ def test_gene001_simple_callback(dash_duo): | ||
| assert dash_duo.wait_for_element("#standard").text == "Standard" | ||
| assert dash_duo.wait_for_element("#nested").text == "Nested" | ||
| dash_duo.percy_snapshot(name="gene001-simple-callback") | ||
| def test_gene002_arbitrary_resources(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = Div([Button(id="btn"), Div(id="container")]) | ||
| @app.callback(Output("container", "children"), [Input("btn", "n_clicks")]) | ||
| def update_container(n_clicks): | ||
| if n_clicks is None: | ||
| raise PreventUpdate | ||
| return MyStandardComponent( | ||
| id="standard", value="Standard", style={"font-family": "godfather"} | ||
| ) | ||
| dash_duo.start_server(app) | ||
| assert ( | ||
| dash_duo.driver.execute_script("return document.fonts.check('1em godfather')") | ||
| is False | ||
| ) | ||
| dash_duo.wait_for_element("#btn").click() | ||
| assert dash_duo.wait_for_element("#standard").text == "Standard" | ||
| WebDriverWait(dash_duo.driver, 10).until( | ||
Collaborator There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this better than Regardless, very nice test! ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wasn't aware I could do that. I thought it was either this of | ||
| lambda _: dash_duo.driver.execute_script( | ||
| "return document.fonts.check('1em godfather')" | ||
| ) | ||
| is True, | ||
| ) | ||
| dash_duo.percy_snapshot(name="gene002-arbitrary-resource") | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pick up everything but the Python artifacts