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

Commit

Permalink
Test to make sure data-* and aria-* actually render
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarren1 committed Apr 4, 2018
1 parent c0f886d commit 56ca583
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def test_initial_state(self):
id='p.c.3',
className="my-class",
title='tooltip',
style={'color': 'red', 'fontSize': 30}
style={'color': 'red', 'fontSize': 30},
**{'data-test': 'dtest',
'aria-test': 'atest'}
),
html.Div(id='p.c.4'),
html.Div([
Expand Down Expand Up @@ -173,7 +175,9 @@ def test_initial_state(self):
'id="p.c.3"',
'class="my-class"',
'title="tooltip"',
], 3)
'data-test="dtest"',
'aria-test="atest"'
], 5)
passed = False
for permutation in permutations:
for style in style_permutations:
Expand Down Expand Up @@ -233,7 +237,9 @@ def test_initial_state(self):
'title': 'tooltip',
'style': {
'color': 'red', 'fontSize': 30
}
},
'data-test': 'dtest',
'aria-test': 'atest'
},
"type": "Div"
},
Expand Down Expand Up @@ -1813,12 +1819,17 @@ def test_update_react_version(self):
# Create a dummy component with no props
# (dash-html-components may not support tested React version)
class TestComponent(Component):
def __init__(self, _namespace):
def __init__(self, _namespace, _valid_wildcard_attributes, _type):
self._prop_names = []
self._namespace = _namespace
self._type = _type
self._valid_wildcard_attributes = _valid_wildcard_attributes
super(TestComponent, self).__init__()

_test_component = TestComponent(_namespace='test-namespace')
_test_component = TestComponent(
_namespace='test-namespace',
_valid_wildcard_attributes=["data-", "aria-"],
_type="MyTestComponent")
app.layout = _test_component

self.startServer(app)
Expand Down

0 comments on commit 56ca583

Please sign in to comment.