Commit 6788a69a authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Use VNode approach in a11y tests where we were wrapping component under test in div

parent 9b112690
...@@ -339,16 +339,13 @@ describe('ImportAnnotations', () => { ...@@ -339,16 +339,13 @@ describe('ImportAnnotations', () => {
it( it(
'should pass a11y checks', 'should pass a11y checks',
checkAccessibility({ checkAccessibility({
content: () => // re. not using `mount`, see https://github.com/hypothesis/client/issues/5690
mount( content: () => (
// re. outer div, see https://github.com/hypothesis/client/issues/5690 <ImportAnnotations
<div> store={fakeStore}
<ImportAnnotations importAnnotationsService={fakeImportAnnotationsService}
store={fakeStore} />
importAnnotationsService={fakeImportAnnotationsService} ),
/>
</div>,
),
}), }),
); );
}); });
...@@ -126,17 +126,11 @@ describe('ShareDialog', () => { ...@@ -126,17 +126,11 @@ describe('ShareDialog', () => {
it( it(
'should pass a11y checks', 'should pass a11y checks',
checkAccessibility({ checkAccessibility({
content: () => // ShareDialog renders a Fragment as its top-level component when
// ShareDialog renders a Fragment as its top-level component when // it has import and/or export tabs.
// it has import and/or export tabs. // Returning the VNode verbatim ensures no children are discarded.
// Wrapping it in a `div` ensures `checkAccessibility` internal logic // See https://github.com/hypothesis/client/issues/5671
// does not discard all the Fragment children but the first one. content: () => <ShareDialog shareTab exportTab importTab />,
// See https://github.com/hypothesis/client/issues/5671
mount(
<div>
<ShareDialog shareTab exportTab importTab />
</div>,
),
}), }),
); );
}); });
......
...@@ -418,10 +418,7 @@ describe('ThreadList', () => { ...@@ -418,10 +418,7 @@ describe('ThreadList', () => {
it( it(
'should pass a11y checks', 'should pass a11y checks',
checkAccessibility({ checkAccessibility({
content: () => { content: () => createComponent(),
const wrapper = createComponent();
return wrapper;
},
}), }),
); );
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment