Skip to content

Commit 1a50d81

Browse files
committed
Copilot updates + minor issue body changes
1 parent 6ac9324 commit 1a50d81

9 files changed

Lines changed: 25 additions & 14 deletions

File tree

.github/actions/file/src/generateIssueBody.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export function generateIssueBody(finding: Finding, screenshotRepo: string): str
1919
}
2020

2121
const acceptanceCriteria = `## Acceptance Criteria
22-
- [ ] The specific axe violation reported in this issue is no longer reproducible.
22+
- [ ] The specific violation reported in this issue is no longer reproducible.
2323
- [ ] The fix MUST meet WCAG 2.1 guidelines OR the accessibility standards specified by the repository or organization.
24-
- [ ] A test SHOULD be added to ensure this specific axe violation does not regress.
24+
- [ ] A test SHOULD be added to ensure this specific violation does not regress.
2525
- [ ] This PR MUST NOT introduce any new accessibility issues or regressions.
2626
`
2727

.github/actions/file/src/updateFilingsWithNewFindings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function getFilingKey(filing: ResolvedFiling | RepeatedFiling): string {
55
}
66

77
function getFindingKey(finding: Finding): string {
8-
return `${finding.url};${finding.ruleId ?? ''};${finding.html ?? ''}`
8+
return `${finding.url};${finding.scannerType};${finding.problemUrl}`
99
}
1010

1111
export function updateFilingsWithNewFindings(

.github/actions/find/src/pluginManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const __dirname = path.dirname(__filename)
1212

1313
type PluginDefaultParams = {
1414
page: playwright.Page
15-
addFinding: (findingData: Finding) => void
15+
addFinding: (findingData: Finding) => Promise<void>
1616
url: string
1717
}
1818

.github/scanner-plugins/reflow-scan/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export default async function reflowScan({ page, addFinding, url } = {}) {
1111
await addFinding({
1212
scannerType: 'reflow-scan',
1313
url,
14-
problemShort: 'Page requires horizontal scrolling at 320x256 viewport',
14+
problemShort: 'page requires horizontal scrolling at 320x256 viewport',
1515
problemUrl: 'https://www.w3.org/WAI/WCAG21/Understanding/reflow.html',
16-
solutionShort: 'Ensure content is responsive and does not require horizontal scrolling at small viewport sizes',
17-
solutionLong: `The page has a scroll width of ${scrollWidth}px but a client width of only ${clientWidth}px at 320x256 viewport, requiring horizontal scrolling. This violates WCAG 2.1 Level AA Success Criterion 1.4.10 (Reflow).`
18-
});
16+
solutionShort: 'ensure content is responsive and does not require horizontal scrolling at small viewport sizes',
17+
solutionLong: `The page has a scroll width of ${scrollWidth}px but a client width of only ${clientWidth}px at 320x256 viewport, requiring horizontal scrolling. This violates WCAG 2.1 Level AA Success Criterion 1.4.10 (Reflow).`,
18+
})
1919
}
2020
} catch (e) {
2121
console.error('Error checking horizontal scroll:', e);

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
repository: ${{ env.TESTING_REPOSITORY }}
8181
token: ${{ secrets.GH_TOKEN }}
8282
cache_key: ${{ steps.cache_key.outputs.cache_key }}
83+
scans: "['axe', 'reflow-scan']"
8384

8485
- name: Retrieve cached results
8586
uses: ./.github/actions/gh-cache/restore

PLUGINS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ A async function (you must use `await` or `.then` when invoking this function) t
2222

2323
- An object that should match the [`Finding` type](https://github.com/github/accessibility-scanner/blob/main/.github/actions/find/src/types.d.ts#L1-L9).
2424

25+
#### `url`
26+
27+
Passes in the URL of the page being scanned to be used when a finding is added.
28+
2529
## How to create plugins
2630

2731
As mentioned above, plugins need to exist under `./.github/scanner-plugins`. For a plugin to work, it needs to meet the following criteria:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
# open_grouped_issues: false # Optional: Set to true to open an issue grouping individual issues per violation
5757
# reduced_motion: no-preference # Optional: Playwright reduced motion configuration option
5858
# color_scheme: light # Optional: Playwright color scheme configuration option
59-
# scans #Optional: An array of scans (or plugins) to be performed. If not provided, only Axe will be performed.
59+
# scans: '["axe","reflow-scan"]' #Optional: An array of scans (or plugins) to be performed. If not provided, only Axe will be performed.
6060
```
6161

6262
> 👉 Update all `REPLACE_THIS` placeholders with your actual values. See [Action Inputs](#action-inputs) for details.

sites/site-with-errors/404.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
line-height: 1;
1616
letter-spacing: -1px;
1717
}
18+
.wide-element {
19+
width: 500px;
20+
background: #eee;
21+
padding: 10px;
22+
}
1823
</style>
1924

2025
<div class="container">
2126
<h1>404</h1>
2227

2328
<p><strong>Page not found :(</strong></p>
2429
<p>The requested page could not be found.</p>
30+
<div class="wide-element">This element is too wide for small viewports.</div>
2531
</div>

tests/site-with-errors.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ describe('site-with-errors', () => {
3838
})
3939

4040
it('cache has expected results', () => {
41-
const actual = results.map(({issue: {url: issueUrl}, findings}) => {
41+
const actual = results.map(;({issue: {url: issueUrl}, findings}) => {
4242
const {problemUrl, solutionLong, screenshotId, ...finding} = findings[0]
4343
// Check volatile fields for existence only
4444
expect(issueUrl).toBeDefined()
4545
expect(problemUrl).toBeDefined()
46-
expect(solutionLong).toBeDefined()
47-
// Check `problemUrl`, ignoring axe version
48-
expect(problemUrl.startsWith('https://dequeuniversity.com/rules/axe/')).toBe(true)
49-
expect(problemUrl.endsWith(`/${finding.ruleId}?application=playwright`)).toBe(true)
46+
// solutionLong is optional for non-axe scans
47+
if (finding.scannerType === 'axe') {
48+
expect(solutionLong).toBeDefined()
49+
}
5050
// screenshotId is only present when include_screenshots is enabled
5151
if (screenshotId !== undefined) {
5252
expect(screenshotId).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)

0 commit comments

Comments
 (0)