Skip to content

Commit 41f49ec

Browse files
kzhou314Copilot
andauthored
Apply suggestions from code review (escape AccessLint solutionShort and pass UrlConfig in tests)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent d07f5eb commit 41f49ec

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/actions/find/src/findForUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async function runAccesslintScan({
124124
problemShort: violation.message.toLowerCase().replace(/'/g, '&apos;'),
125125
problemUrl: 'https://github.com/AccessLint/accesslint/blob/main/core/README.md#rules-1',
126126
ruleId: violation.ruleId,
127-
solutionShort: `resolve the ${violation.ruleId} violation that accesslint flagged on \`${violation.selector}\``,
127+
solutionShort: `resolve the ${violation.ruleId} violation that accesslint flagged on \`${violation.selector}\``.replace(/'/g, '&apos;'),
128128
})
129129
}
130130
}

.github/actions/find/tests/findForUrl.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe('findForUrl', () => {
115115
actionInput = JSON.stringify(['accesslint'])
116116
clearAll()
117117

118-
await findForUrl('test.com')
118+
await findForUrl({url: 'test.com'})
119119
expect(accesslintAudit).toHaveBeenCalledTimes(1)
120120
expect(AxeBuilder.prototype.analyze).toHaveBeenCalledTimes(0)
121121
expect(pluginManager.loadPlugins).toHaveBeenCalledTimes(0)
@@ -125,7 +125,7 @@ describe('findForUrl', () => {
125125
actionInput = JSON.stringify(['axe', 'accesslint'])
126126
clearAll()
127127

128-
await findForUrl('test.com')
128+
await findForUrl({url: 'test.com'})
129129
expect(AxeBuilder.prototype.analyze).toHaveBeenCalledTimes(1)
130130
expect(accesslintAudit).toHaveBeenCalledTimes(1)
131131
expect(pluginManager.loadPlugins).toHaveBeenCalledTimes(0)
@@ -140,7 +140,7 @@ describe('findForUrl', () => {
140140
actionInput = JSON.stringify(['accesslint', 'custom-scan-1'])
141141
clearAll()
142142

143-
await findForUrl('test.com')
143+
await findForUrl({url: 'test.com'})
144144
expect(accesslintAudit).toHaveBeenCalledTimes(1)
145145
expect(pluginManager.invokePlugin).toHaveBeenCalledTimes(1)
146146
expect(loadedPlugins[0].default).toHaveBeenCalledTimes(1)

0 commit comments

Comments
 (0)