Skip to content

Commit 0529d1b

Browse files
chore(deps): update dependency eslint-plugin-jsx-a11y to v6.8.0 (#4961)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: julieg18 <[email protected]>
1 parent 3b6cd12 commit 0529d1b

File tree

4 files changed

+152
-128
lines changed

4 files changed

+152
-128
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"eslint-plugin-etc": "2.0.3",
4646
"eslint-plugin-import": "2.29.0",
4747
"eslint-plugin-jest": "27.6.0",
48-
"eslint-plugin-jsx-a11y": "6.7.1",
48+
"eslint-plugin-jsx-a11y": "6.8.0",
4949
"eslint-plugin-n": "16.2.0",
5050
"eslint-plugin-prettier": "5.0.1",
5151
"eslint-plugin-promise": "6.1.1",

webview/src/plots/components/App.test.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,22 @@ describe('App', () => {
833833
})
834834
})
835835

836+
it('should toggle the custom plots section on Enter key press', async () => {
837+
renderAppWithOptionalData({
838+
custom: customPlotsFixture
839+
})
840+
const summaryElement = await screen.findByText('Custom')
841+
842+
fireEvent.keyDown(summaryElement, {
843+
key: 'Enter'
844+
})
845+
846+
expect(mockPostMessage).toHaveBeenCalledWith({
847+
payload: { [PlotsSection.CUSTOM_PLOTS]: true },
848+
type: MessageFromWebviewType.TOGGLE_PLOTS_SECTION
849+
})
850+
})
851+
836852
it('should display a slider to pick the number of items per row if there are items and the action is available', () => {
837853
const store = renderAppWithOptionalData({
838854
custom: customPlotsFixture

webview/src/shared/components/sectionContainer/SectionContainer.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,17 @@ export const SectionContainer: React.FC<
7171
open={open}
7272
className={styles.sectionContainer}
7373
>
74-
<summary onClick={toggleSection} style={{ top: stickyHeaderTop }}>
74+
<summary
75+
onClick={toggleSection}
76+
onKeyDown={event => {
77+
if (event.key === 'Enter') {
78+
onToggleSection()
79+
}
80+
}}
81+
tabIndex={0}
82+
role="button"
83+
style={{ top: stickyHeaderTop }}
84+
>
7585
<div className={styles.summaryTitle}>
7686
<Icon
7787
icon={open ? ChevronDown : ChevronRight}

0 commit comments

Comments
 (0)