open: displayed
}
)}>
- <h2 className="back-button big-padded bordered-bottom" onClick={() => onPageChange()}>
- <BackIcon className="little-spacer-right" />
- {translate('back')}
- </h2>
-
- {displayed && <div className="overflow-y-auto big-padded">{children}</div>}
+ {displayed && (
+ <>
+ <a
+ className="h2 back-button big-padded bordered-bottom"
+ onClick={() => onPageChange()}
+ role="link"
+ tabIndex={-1}>
+ <BackIcon className="little-spacer-right" />
+ {translate('back')}
+ </a>
+ <div className="overflow-y-auto big-padded">{children}</div>
+ </>
+ )}
</div>
);
}
it('should call onPageChange when clicked', () => {
const onPageChange = jest.fn();
- const wrapper = shallowRender({ onPageChange });
+ const wrapper = shallowRender({ onPageChange, displayed: true });
wrapper.find('.back-button').simulate('click');
exports[`should render correctly 1`] = `
<div
className="info-drawer-page info-drawer-pane display-flex-column overflow-hidden"
->
- <h2
- className="back-button big-padded bordered-bottom"
- onClick={[Function]}
- >
- <BackIcon
- className="little-spacer-right"
- />
- back
- </h2>
-</div>
+/>
`;
exports[`should render correctly 2`] = `
<div
className="info-drawer-page info-drawer-pane display-flex-column overflow-hidden open"
>
- <h2
- className="back-button big-padded bordered-bottom"
+ <a
+ className="h2 back-button big-padded bordered-bottom"
onClick={[Function]}
+ role="link"
+ tabIndex={-1}
>
<BackIcon
className="little-spacer-right"
/>
back
- </h2>
+ </a>
<div
className="overflow-y-auto big-padded"
>