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

Commit 56ca583

Browse files
committed
Test to make sure data-* and aria-* actually render
1 parent c0f886d commit 56ca583

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

Diff for: tests/test_render.py

+16-5
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def test_initial_state(self):
7777
id='p.c.3',
7878
className="my-class",
7979
title='tooltip',
80-
style={'color': 'red', 'fontSize': 30}
80+
style={'color': 'red', 'fontSize': 30},
81+
**{'data-test': 'dtest',
82+
'aria-test': 'atest'}
8183
),
8284
html.Div(id='p.c.4'),
8385
html.Div([
@@ -173,7 +175,9 @@ def test_initial_state(self):
173175
'id="p.c.3"',
174176
'class="my-class"',
175177
'title="tooltip"',
176-
], 3)
178+
'data-test="dtest"',
179+
'aria-test="atest"'
180+
], 5)
177181
passed = False
178182
for permutation in permutations:
179183
for style in style_permutations:
@@ -233,7 +237,9 @@ def test_initial_state(self):
233237
'title': 'tooltip',
234238
'style': {
235239
'color': 'red', 'fontSize': 30
236-
}
240+
},
241+
'data-test': 'dtest',
242+
'aria-test': 'atest'
237243
},
238244
"type": "Div"
239245
},
@@ -1813,12 +1819,17 @@ def test_update_react_version(self):
18131819
# Create a dummy component with no props
18141820
# (dash-html-components may not support tested React version)
18151821
class TestComponent(Component):
1816-
def __init__(self, _namespace):
1822+
def __init__(self, _namespace, _valid_wildcard_attributes, _type):
18171823
self._prop_names = []
18181824
self._namespace = _namespace
1825+
self._type = _type
1826+
self._valid_wildcard_attributes = _valid_wildcard_attributes
18191827
super(TestComponent, self).__init__()
18201828

1821-
_test_component = TestComponent(_namespace='test-namespace')
1829+
_test_component = TestComponent(
1830+
_namespace='test-namespace',
1831+
_valid_wildcard_attributes=["data-", "aria-"],
1832+
_type="MyTestComponent")
18221833
app.layout = _test_component
18231834

18241835
self.startServer(app)

0 commit comments

Comments
 (0)