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', () => {
it(
'should pass a11y checks',
checkAccessibility({
content: () =>
mount(
// re. outer div, see https://github.com/hypothesis/client/issues/5690
<div>
// re. not using `mount`, see https://github.com/hypothesis/client/issues/5690
content: () => (
<ImportAnnotations
store={fakeStore}
importAnnotationsService={fakeImportAnnotationsService}
/>
</div>,
),
}),
);
......
......@@ -126,17 +126,11 @@ describe('ShareDialog', () => {
it(
'should pass a11y checks',
checkAccessibility({
content: () =>
// ShareDialog renders a Fragment as its top-level component when
// it has import and/or export tabs.
// Wrapping it in a `div` ensures `checkAccessibility` internal logic
// does not discard all the Fragment children but the first one.
// Returning the VNode verbatim ensures no children are discarded.
// See https://github.com/hypothesis/client/issues/5671
mount(
<div>
<ShareDialog shareTab exportTab importTab />
</div>,
),
content: () => <ShareDialog shareTab exportTab importTab />,
}),
);
});
......
......@@ -418,10 +418,7 @@ describe('ThreadList', () => {
it(
'should pass a11y checks',
checkAccessibility({
content: () => {
const wrapper = createComponent();
return wrapper;
},
content: () => createComponent(),
}),
);
});
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