Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Enable accessibilityAudit on batches.test.ts #33824

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

gitstart-sourcegraph
Copy link
Collaborator

@gitstart-sourcegraph gitstart-sourcegraph commented Apr 13, 2022

Description

  • Enabling accessibility audit on batches page in its integration test

Refs

SG Issue
Gitstart Ticket

Test plan

Run the integration test yarn test-integration:base client/web/src/integration/batches.test.ts

Success criteria

  • All integration tests with percy snapshots have accessibilityAudit enabled

App preview:

Check out the client app preview documentation to learn more.

@cla-bot cla-bot bot added the cla-signed label Apr 13, 2022
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Apr 13, 2022

Codenotify: Notifying subscribers in CODENOTIFY files for diff 061438d...d6a7579.

Notify File(s)
@courier-new client/web/src/enterprise/batches/ChangesetFilter.tsx
client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.tsx
client/web/src/enterprise/batches/detail/BatchChangeStatsCard.tsx
client/web/src/enterprise/batches/detail/changesets/BatchChangeChangesets.tsx
client/web/src/enterprise/batches/detail/changesets/BatchChangeChangesetsHeader.tsx
client/web/src/enterprise/batches/detail/changesets/ExternalChangesetNode.tsx
client/web/src/enterprise/batches/list/BatchChangeListPage.tsx
client/web/src/enterprise/batches/list/BatchChangeNode.tsx
client/web/src/enterprise/batches/preview/BatchChangePreviewPage.tsx
client/web/src/enterprise/batches/preview/list/PreviewListHeader.tsx
client/web/src/enterprise/batches/preview/list/VisibleChangesetApplyPreviewNode.tsx
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.tsx
client/web/src/integration/batches.test.ts
@eseliger client/web/src/enterprise/batches/ChangesetFilter.tsx
client/web/src/enterprise/batches/detail/BatchChangeDetailsPage.tsx
client/web/src/enterprise/batches/detail/BatchChangeStatsCard.tsx
client/web/src/enterprise/batches/detail/changesets/BatchChangeChangesets.tsx
client/web/src/enterprise/batches/detail/changesets/BatchChangeChangesetsHeader.tsx
client/web/src/enterprise/batches/detail/changesets/ExternalChangesetNode.tsx
client/web/src/enterprise/batches/list/BatchChangeListPage.tsx
client/web/src/enterprise/batches/list/BatchChangeNode.tsx
client/web/src/enterprise/batches/preview/BatchChangePreviewPage.tsx
client/web/src/enterprise/batches/preview/list/PreviewListHeader.tsx
client/web/src/enterprise/batches/preview/list/VisibleChangesetApplyPreviewNode.tsx
client/web/src/enterprise/batches/settings/CodeHostConnectionNode.tsx
client/web/src/integration/batches.test.ts

@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Apr 13, 2022

Codenotify: Notifying subscribers in OWNERS files for diff 061438d...d6a7579.

No notifications.

@gitstart-sourcegraph gitstart-sourcegraph self-assigned this Apr 13, 2022
@gitstart-sourcegraph gitstart-sourcegraph changed the title [SG-33093.1.2] Enable accessibilityAudit on client/web/src/integration/batches.test.ts Enable accessibilityAudit on batches.test.ts Apr 13, 2022
@gitstart-sourcegraph gitstart-sourcegraph added the gitstart Contract partner label Apr 13, 2022
Copy link
Contributor

@umpox umpox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a few areas where we should be able to update the heading tags. LMK if this isn't possible

Rule: "heading-order" (Heading levels should only increase by one)
To support accessibility rule here, we would need to use h3 tag, since PageHeader(on upper scope) renders h1 and h2 subsequently
*/}
<h5 className="a11y-ignore p-2 d-none d-md-block text-uppercase text-center text-nowrap">Status</h5>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a h3 tag?

It should be possible to do this and preserve styles using the WIldcard components

<H5 as={H3}>{label}</H5>

{(licenseAndUsageInfo?.allBatchChanges.totalCount || 0) > 0 && (
<h3 className="align-self-end flex-1">{lastTotalCount} batch changes</h3>
<h3 className="a11y-ignore align-self-end flex-1">{lastTotalCount} batch changes</h3>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to use H2 here too :)

Rule: "heading-order" (Heading levels should only increase by one)
To support accessibility rule here, we would need to use h3 tag, since PageHeader(on upper scope) renders h1 and h2 subsequently
*/}
<h5 className="a11y-ignore p-2 d-none d-sm-block text-uppercase text-center">Current state</h5>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update heading :)

Rule: "heading-order" (Heading levels should only increase by one)
To support accessibility rule here, we would need to use h4 tag and have h2 somewhere in the page, since PageHeader(on upper scope) renders h1 tag and there is an h3 tag as well.
*/}
<h5 className="a11y-ignore">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also heading here

@umpox
Copy link
Contributor

umpox commented Apr 19, 2022

@gitstart-sourcegraph Looks like there are some visual regressions on the batch changes heading, please can we fix?

Comment on lines +331 to 333
// To fix accessibility rule: "heading-order"
description: '## Very cool batch change',
creator: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gitstart-sourcegraph Looks like there are some visual regressions on the batch changes heading, please can we fix?

Hi @umpox, the UI diff as displayed in the percySnapshot occurs with respect to this fix we made here, which involved updating the test parameter from rendering an h3 (fails accessibility check: "heading-order") to instead render h2 (as header description in markdown with ##).
BTW this would not have an effect on actual rendering on web app, since description is generated with user input.
WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, I missed that - sorry!

LGTM :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

@gitstart-sourcegraph gitstart-sourcegraph merged commit 357dc4d into main Apr 20, 2022
@gitstart-sourcegraph gitstart-sourcegraph deleted the contractors/SG-33093.1.2 branch April 20, 2022 14:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed gitstart Contract partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility: Enable accessibilityAudit on different pages in our integration tests
4 participants