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,15 +339,12 @@ describe('ImportAnnotations', () => { ...@@ -339,15 +339,12 @@ 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
<div>
<ImportAnnotations <ImportAnnotations
store={fakeStore} store={fakeStore}
importAnnotationsService={fakeImportAnnotationsService} 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.
// Wrapping it in a `div` ensures `checkAccessibility` internal logic // Returning the VNode verbatim ensures no children are discarded.
// does not discard all the Fragment children but the first one.
// See https://github.com/hypothesis/client/issues/5671 // See https://github.com/hypothesis/client/issues/5671
mount( content: () => <ShareDialog shareTab exportTab importTab />,
<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