Skip to content

Commit f9a77a4

Browse files
Fix openIssue array signature and category tests after merge
1 parent 50bc06b commit f9a77a4

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/actions/file/src/openIssue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export async function openIssue(octokit: Octokit, repoWithOwner: string, finding
2828
labels.push(`${primary.scannerType} rule: ${primary.ruleId}`)
2929
}
3030
// Flag non-WCAG findings so they can be filtered or triaged separately
31-
if (finding.category && finding.category !== 'wcag') {
32-
labels.push(finding.category)
31+
if (primary.category && primary.category !== 'wcag') {
32+
labels.push(primary.category)
3333
}
3434

3535
const count = findings.length

.github/actions/file/tests/openIssue.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('openIssue', () => {
6767

6868
it('adds a category label for non-WCAG findings', async () => {
6969
const octokit = mockOctokit()
70-
await openIssue(octokit, 'org/repo', {...baseFinding, category: 'best-practice'})
70+
await openIssue(octokit, 'org/repo', [{...baseFinding, category: 'best-practice'}])
7171

7272
expect(octokit.request).toHaveBeenCalledWith(
7373
expect.any(String),
@@ -79,7 +79,7 @@ describe('openIssue', () => {
7979

8080
it('does not add a category label for WCAG findings', async () => {
8181
const octokit = mockOctokit()
82-
await openIssue(octokit, 'org/repo', {...baseFinding, category: 'wcag'})
82+
await openIssue(octokit, 'org/repo', [{...baseFinding, category: 'wcag'}])
8383

8484
const labels = octokit.request.mock.calls[0][1].labels
8585
expect(labels).not.toContain('wcag')

0 commit comments

Comments
 (0)