A11y/Dashboard: Fix various fastpass issues for dashboard settings (#40335)

* A11y/Dashboard: Fix various fastpass issue for dashboard settings
See #39429
This commit is contained in:
kay delaney
2021-10-18 13:51:26 +01:00
committed by GitHub
parent f7cbb298f7
commit db62ce477d
8 changed files with 27 additions and 11 deletions

View File

@@ -63,6 +63,7 @@ export const AutoRefreshIntervals: FC<Props> = ({
invalid={!!invalidIntervalsMessage}
>
<Input
id="auto-refresh-input"
invalid={!!invalidIntervalsMessage}
value={intervalsString}
onChange={onIntervalsChange}

View File

@@ -86,16 +86,17 @@ export function GeneralSettingsUnconnected({ dashboard, updateTimeZone }: Props)
</h3>
<div className="gf-form-group">
<Field label="Name">
<Input name="title" onBlur={onBlur} defaultValue={dashboard.title} />
<Input id="title-input" name="title" onBlur={onBlur} defaultValue={dashboard.title} />
</Field>
<Field label="Description">
<Input name="description" onBlur={onBlur} defaultValue={dashboard.description} />
<Input id="description-input" name="description" onBlur={onBlur} defaultValue={dashboard.description} />
</Field>
<Field label="Tags">
<TagsInput tags={dashboard.tags} onChange={onTagsChange} />
</Field>
<Field label="Folder">
<FolderPicker
inputId="dashboard-folder-input"
initialTitle={dashboard.meta.folderTitle}
initialFolderId={dashboard.meta.folderId}
onChange={onFolderChange}

View File

@@ -132,7 +132,7 @@ describe('LinksSettings', () => {
expect(getTableBodyRows().length).toBe(links.length);
// TODO remove skipPointerEventsCheck once https://github.com/jsdom/jsdom/issues/3232 is fixed
userEvent.click(within(getTableBody()).getAllByRole('button', { name: /delete/i })[0], undefined, {
userEvent.click(within(getTableBody()).getAllByRole('button', { name: 'Delete' })[0], undefined, {
skipPointerEventsCheck: true,
});

View File

@@ -83,13 +83,17 @@ export class TimePickerSettings extends PureComponent<Props, State> {
/>
</Field>
<Field label="Hide time picker">
<Switch value={!!this.props.timePickerHidden} onChange={this.onHideTimePickerChange} />
<Switch
id="hide-time-picker-toggle"
value={!!this.props.timePickerHidden}
onChange={this.onHideTimePickerChange}
/>
</Field>
<Field
label="Refresh live dashboards"
description="Continuously re-draw panels where the time range references 'now'"
>
<Switch value={!!this.props.liveNow} onChange={this.onLiveNowChange} />
<Switch id="refresh-live-dashboards-toggle" value={!!this.props.liveNow} onChange={this.onLiveNowChange} />
</Field>
</CollapsableSection>
);