This repository was archived by the owner on Jun 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 143
772 set href as a required prop and as the default value for children #776
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cc0f0cc
Conditionally set children as href
HammadTheOne efbdd4c
773 - Make href a required prop
HammadTheOne 738ed20
Updated changelog
HammadTheOne 86ad1fa
Linting changes
HammadTheOne dd1a95e
Added basic integration test
HammadTheOne 89ed2c0
Slight fixes to PR number
HammadTheOne 4d966f5
Fixed test
HammadTheOne 40b9502
Update tests/integration/link/test_link_children.py
HammadTheOne 4537402
Updated test
HammadTheOne 5f7e930
Used a more concise ramda helper
HammadTheOne da999d5
Further refinement
HammadTheOne 065c462
Formatting
HammadTheOne fc5d694
Merge branch 'dev' into 772-link-default-children
HammadTheOne 5eac66e
Added test for children
HammadTheOne 5a53fc2
Fixed linting error
HammadTheOne fa29fcf
Merge branch 'dev' into 772-link-default-children
HammadTheOne 07a736c
Fixed dev merge error
HammadTheOne 06d39e3
Flaky test-27
HammadTheOne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pytest | ||
import dash | ||
from dash.dependencies import Input, Output | ||
import dash_core_components as dcc | ||
import dash_html_components as html | ||
|
||
|
||
@pytest.mark.DCC776 | ||
def test_lich001_default(dash_dcc): | ||
app = dash.Dash(__name__) | ||
app.layout = html.Div( | ||
[ | ||
dcc.Link(id="link1", href="/page-1"), | ||
dcc.Location(id="url", refresh=False), | ||
html.Div(id="content") | ||
] | ||
) | ||
dash_dcc.start_server(app) | ||
|
||
dash_dcc.wait_for_text_to_equal("#link1", "/page-1") | ||
|
||
|
||
@pytest.mark.DCC776 | ||
def test_lich002_children(dash_dcc): | ||
app = dash.Dash(__name__) | ||
app.layout = html.Div( | ||
[ | ||
dcc.Link(children='test children', id="link1", href="/page-1"), | ||
dcc.Location(id="url", refresh=False), | ||
html.Div(id="content") | ||
] | ||
) | ||
@app.callback(Output("content", "children"), [Input("link1", "children")]) | ||
def display_children(children): | ||
return children | ||
|
||
dash_dcc.start_server(app) | ||
|
||
dash_dcc.wait_for_text_to_equal("#content", "test children") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this callback and
content
Div do anything in this test?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.
Can you add another simple test checking that children are indeed children when defined
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.
Added in 5eac66e.